QTfrontend/util/FileEngine.h
branchphysfslayer
changeset 7770 ff3442338882
parent 7768 13e2037ebc79
child 7955 85b3970b402a
--- a/QTfrontend/util/FileEngine.h	Sat Oct 20 00:20:39 2012 +0400
+++ b/QTfrontend/util/FileEngine.h	Sun Oct 21 00:31:48 2012 +0400
@@ -3,6 +3,7 @@
 
 #include <QAbstractFileEngine>
 #include <QAbstractFileEngineHandler>
+#include <QAbstractFileEngineIterator>
 #include <QDateTime>
 
 #include "physfs.h"
@@ -28,6 +29,7 @@
         virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
         virtual bool caseSensitive() const;
         virtual bool isRelativePath() const;
+        QAbstractFileEngineIterator *beginEntryList(QDir::Filters filters, const QStringList & filterNames);
         virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
         virtual FileFlags fileFlags(FileFlags type=FileInfoAll) const;
         virtual QString fileName(FileName file=DefaultName) const;
@@ -36,7 +38,6 @@
         bool atEnd() const;
 
         virtual qint64 read(char *data, qint64 maxlen);
-        virtual qint64 readLine(char *data, qint64 maxlen);
         virtual qint64 write(const char *data, qint64 len);
 
         bool isOpened() const;
@@ -57,7 +58,29 @@
 class FileEngineHandler : public QAbstractFileEngineHandler
 {
     public:
+        FileEngineHandler(char * argv0);
+        ~FileEngineHandler();
+
         QAbstractFileEngine *create(const QString &filename) const;
+
+        void mount(const QString & path);
+        void setWriteDir(const QString & path);
+
+//    private:
+        static const QString scheme;
+};
+
+class FileEngineIterator : public QAbstractFileEngineIterator
+{
+public:
+        FileEngineIterator(QDir::Filters filters, const QStringList & nameFilters, const QStringList & entries);
+
+        bool hasNext() const;
+        QString next();
+        QString currentFileName() const;
+private:
+        QStringList m_entries;
+        int m_index;
 };
 
 #endif