| 1 | // Copyright (C) 2014 Sacha Refshauge |
| 2 | |
| 3 | // This program is free software: you can redistribute it and/or modify |
| 4 | // it under the terms of the GNU General Public License as published by |
| 5 | // the Free Software Foundation, version 3.0. |
| 6 | |
| 7 | // This program is distributed in the hope that it will be useful, |
| 8 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | // GNU General Public License 3.0 for more details. |
| 11 | |
| 12 | // A copy of the GPL 3.0 should have been included with the program. |
| 13 | // If not, see http://www.gnu.org/licenses/ |
| 14 | |
| 15 | // Official GIT repository and contact information can be found at |
| 16 | // http://github.com/xsacha/Sachesi |
| 17 | |
| 18 | #pragma once |
| 19 | |
| 20 | #include "fs.h" |
| 21 | |
| 22 | namespace FS { |
| 23 | |
| 24 | struct binode { |
| 25 | int mode; |
| 26 | QString name; |
| 27 | int offset; |
| 28 | // TODO: Sizes greater than 16-bit? |
| 29 | qint16 size; |
| 30 | int time; |
| 31 | QString path_to; |
| 32 | int chunks; |
| 33 | }; |
| 34 | |
| 35 | class IFS : public QFileSystem |
| 36 | { |
| 37 | Q_OBJECT |
| 38 | |
| 39 | public: |
| 40 | explicit IFS(QString filename, QIODevice* file, qint64 offset, qint64 size, QString path) |
| 41 | : QFileSystem(filename, file, offset, size, path, ".ifs") {} |
| 42 | |
| 43 | binode createBNode(int offset, qint64 startPos); |
| 44 | QString generateName(QString imageExt = ""); |
| 45 | void extractDir(int offset, int numNodes, QString basedir, qint64 startPos); |
| 46 | bool createContents(); |
| 47 | |
| 48 | }; |
| 49 | } |