#ifndef DUST3D_DS3_FILE_H #define DUST3D_DS3_FILE_H #include #include #include #include /* DUST3D 1.0 xml 12345 ... Binary content ... */ class Ds3ReaderItem { public: QString type; QString name; long long offset; long long size; }; class Ds3FileReader : public QObject { Q_OBJECT public: Ds3FileReader(const QString &filename); void loadItem(const QString &name, QByteArray *byteArray); const QList &items(); static QString m_applicationName; static QString m_fileFormatVersion; static QString m_headFormat; private: std::map m_itemsMap; QList m_items; QString m_filename; private: QString readFirstLine(); bool m_headerIsGood; long long m_binaryOffset; }; class Ds3WriterItem { public: QString type; QString name; QByteArray byteArray; }; class Ds3FileWriter : public QObject { Q_OBJECT public: bool add(const QString &name, const QString &type, const QByteArray *byteArray); bool save(const QString &filename); private: std::map m_itemsMap; QList m_items; QString m_filename; }; #endif