00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00032 #ifndef __SO3_SCOL_PARTITION_H__
00033 #define __SO3_SCOL_PARTITION_H__
00034
00035 #include "../ScolBasic/SO3Std.h"
00036
00037 namespace SO3
00038 {
00039
00045 class SO3ScolFileSystemArchive : public Ogre::Archive
00046 {
00047 public:
00048 protected:
00049 Ogre::String scolPartitionPath;
00050 private:
00051
00052 public:
00056 SO3ScolFileSystemArchive(const Ogre::String& name, const Ogre::String& archType);
00057
00061 ~SO3ScolFileSystemArchive();
00062
00066 bool isCaseSensitive() const;
00067
00071 void load();
00072
00076 void unload();
00077
00081 #if OGRE_VERSION < ((1 << 16) | (7 << 8) | 0)
00082 Ogre::DataStreamPtr open(const Ogre::String& filename) const;
00083 #else
00084 Ogre::DataStreamPtr open(const Ogre::String& filename, bool readOnly = true) const;
00085 #endif
00086
00090 Ogre::StringVectorPtr list(bool recursive = true, bool dirs = false);
00091
00095 Ogre::FileInfoListPtr listFileInfo(bool recursive = true, bool dirs = false);
00096
00100 Ogre::StringVectorPtr find(const Ogre::String& pattern, bool recursive = true, bool dirs = false);
00101
00105
00106 #if OGRE_VERSION < ((1 << 16) | (7 << 8) | 0)
00107 Ogre::FileInfoListPtr findFileInfo(const Ogre::String& pattern, bool recursive = true, bool dirs = false);
00108 #else
00109 Ogre::FileInfoListPtr findFileInfo(const Ogre::String& pattern, bool recursive = true, bool dirs = false) const;
00110 #endif
00111
00115 bool exists(const Ogre::String& filename);
00116
00120 time_t getModifiedTime(const Ogre::String& filename);
00121 protected:
00131 void findFiles(const Ogre::String& pattern, bool recursive, bool dirs, Ogre::StringVector* simpleList, Ogre::FileInfoList* detailList);
00132
00136 bool is_reserved_dir(const char*fn);
00137
00140 Ogre::String scolToAbsolutePath(const Ogre::String& base, const Ogre::String& name) const;
00141
00144 bool is_absolute_path(const char* path) const;
00145 private:
00146 };
00147
00151 class SO3ScolFileSystemArchiveFactory : public Ogre::ArchiveFactory
00152 {
00153 public:
00154 protected:
00155 private:
00156
00157 public:
00161 virtual ~SO3ScolFileSystemArchiveFactory()
00162 {
00163 }
00164
00168 const Ogre::String& getType() const
00169 {
00170 static Ogre::String name = "ScolFileSystem";
00171 return name;
00172 }
00173
00177 Ogre::Archive *createInstance(const Ogre::String& name)
00178 {
00179 return OGRE_NEW SO3ScolFileSystemArchive(name, "ScolFileSystem");
00180 }
00181
00185 void destroyInstance(Ogre::Archive* arch)
00186 {
00187 delete arch;
00188 }
00189 protected:
00190 private:
00191 };
00192
00193 }
00194
00195 #endif