Alientech 0.01
An extendable game engine
C:/Alientech/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 {
00010         namespace utils
00011         {
00018                 class ACHDirectory
00019                 {
00020                 private:
00021                         vector<ACHDirectory*> subdirectories;
00022                         vector<ACHFile*> files;
00023 
00024                         string name;
00025                         string path;
00026                         ACHDirectory* parent;
00027                 public:
00032                         ACHDirectory(ACHDirectory* Parent=NULL, string Name="root");
00033 
00035                         string getName();
00036 
00038                         ACHDirectory* getParent();
00039 
00041                         string getPath();
00042 
00044                         vector<ACHFile*> getListOfFiles();
00045 
00047                         vector<ACHDirectory*> getListOfSubdirs();
00048 
00052                         void print(string pre="");
00053                 
00057                         void setName(string NewName);
00058 
00062                         void setParent(ACHDirectory* NewParent);
00063 
00065                         void updatePath();
00066 
00070                         void addSubdir(ACHDirectory* subdirectory);
00071 
00075                         void addFile(ACHFile* file);
00076                 
00081                         bool containsSubdir(string DirectoryName);
00082 
00087                         bool containsFile(string FileName);
00088 
00092                         static ACHDirectory* readDirectory(ifstream* file);
00093 
00098                         static string buildFilePath(ACHFile* File);
00099 
00104                         void destroy();
00105 
00112                         ACHFile* getFile(string path);
00113                 };
00114         }
00115 }
00116 
00117 #endif //C_ACH_DIRECTORY_H