Added comments for StarDictReaders
[mdictionary] / src / plugins / stardict / UncompressedReader.h
index eeb8582..462e08d 100644 (file)
 #include <QString>
 #include "StarDictReader.h"
 
+
+/*!
+  Class implementing StarDictReader interface and handling rading from uncompressed files
+  */
 class UncompressedReader : public StarDictReader
 {
     Q_OBJECT
 public:
     UncompressedReader(QObject *parent = 0);
+
+    /*!
+      Creates new reader and open file with passed filename
+      */
     UncompressedReader(QString filename, QObject *parent = 0);
+
+    /*!
+      Destructs object and closing file
+    */
     ~UncompressedReader();
 
+    /*!
+      Reads translations text from file
+      \param offset 32-bit offset of translation in file, readed
+             from idx file
+      \param len length of translation, readed from idx file too
+      */
     QString readString(qint32 offset, qint32 len);
+
+    /*!
+      Reads translations text from file
+      \param offset 64-bit offset of translation in file, readed
+             from idx file
+      \param len length of translation, readed from idx file too
+      */
     QString readString(qint64 offset, qint32 len);
-    QChar readChar();
+
+    /*!
+      Reads 32-bits integer value from file and convert it from
+      BigEndian to Little Endian
+      */
     qint32 readInt32BigEndian();
+
+    /*!
+      Reads 64-bits integer value from file and convert it from
+      BigEndian to Little Endian
+      */
     qint64 readInt64BigEndian();
+
+    /*!
+      Reads single string from file, end of string is marked as '\0'
+     in file.
+     */
     QString readKeyword();
-    bool open(QString file);
+
+
+    /*!
+      Closing file;
+      */
     void close();
 
+protected:
+    /*!
+      Opens file
+      \returns true if file is opened or false otherwise
+      */
+    bool open(QString file);
+
+    /*!
+      Reads single char from compressed.
+     */
+    QChar readChar();
+
 private:
     QFile _file;
     QDataStream _stream;