00001 #ifndef GLOBALPROPSFILE_H 00002 #define GLOBALPROPSFILE_H 00003 00004 #include <map> 00005 #include <exception> 00006 #include <PropsFile.h> 00007 00018 BOREALIS_NAMESPACE_BEGIN; 00019 00020 class GlobalPropsFile 00021 { 00022 public: 00023 // Sets the file that the global PropsFile will report on, and creates the one 00024 // instance that's used by all the other methods. 00025 // 00026 // Throws an exception if any of the elements in the file aren't properly 00027 // parsable, or if an instance already exists, or if the file doesn't exist. 00028 // 00029 // The instance is valid until destroyInstance() is called. 00030 static void makeInstance(string filepath) 00031 throw (exception); 00032 00033 // Destroys the instance of this object created by makeInstance. 00034 static void destroyInstance() 00035 throw (exception); 00036 00037 // Returns a pointer to the instance of the PropsFile. There must *be* a 00038 // current instance for this to work. 00039 static const PropsFile * getInstance() 00040 throw (exception); 00041 00042 private: 00043 GlobalPropsFile(); 00044 virtual ~GlobalPropsFile(); 00045 00046 static PropsFile * s_pInstance; 00047 }; 00048 00049 BOREALIS_NAMESPACE_END; 00050 00051 #endif