Alientech 0.01
An extendable game engine
C:/Alientech/tempClone/AlienCargoHold/CACHDirectory.h
Go to the documentation of this file.
00001 #ifndef C_ACH_DIRECTORY_H
00002 #define C_ACH_DIRECTORY_H
00003 #include <vector>
00004 #include "ACHCommonUtils.h"
00005 #include "CACHFile.h"
00006 using namespace std;
00007 
00008 namespace alien
00009 {
00016         class ACHDirectory
00017         {
00018         private:
00019                 vector<ACHDirectory*> subdirectories;
00020                 vector<ACHFile*> files;
00021 
00022                 string name;
00023                 ACHDirectory* parent;
00024         public:
00029                 ACHDirectory(ACHDirectory* Parent=NULL, string Name="root");
00030 
00032                 string getName();
00033 
00035                 ACHDirectory* getParent();
00036 
00038                 vector<string> getListOfFiles();
00039 
00041                 vector<string> getListOfSubdirs();
00042 
00046                 void print(string pre="");
00047                 
00051                 void setName(string NewName);
00052 
00056                 void setParent(ACHDirectory* NewParent);
00057 
00061                 void addSubdir(ACHDirectory* subdirectory);
00062 
00066                 void addFile(ACHFile* file);
00067                 
00072                 bool containsSubdir(string DirectoryName);
00073 
00078                 bool containsFile(string FileName);
00079 
00083                 static ACHDirectory* readDirectory(ifstream* file);
00084 
00089                 void destroy();
00090         };
00091 }
00092 
00093 #endif //C_ACH_DIRECTORY_H