![]() |
rtVTK
0.6.0
|
00001 00016 #ifndef StandAlone_Configuration_h 00017 #define StandAlone_Configuration_h 00018 00019 #include <map> 00020 using std::map; 00021 00022 #include <string> 00023 using std::string; 00024 00025 #include <QDir> 00026 #include <QString> 00027 00028 00029 namespace rtVTK 00030 { 00031 00032 class Configuration 00033 { 00034 public: 00035 00037 // Static members 00038 00039 static const string filename; 00040 00041 00043 // Member functions 00044 00045 Configuration(); 00046 00047 QDir& operator[](const string& option) 00048 { 00049 return config[option]; 00050 } 00051 00052 void setDefaultScene(const QString& newDfltScene) 00053 { 00054 dfltScene = newDfltScene; 00055 write(); // Always automatically call write after changing default scene. 00056 } 00057 00058 const QString& getDefaultScene() const 00059 { 00060 return dfltScene; 00061 } 00062 00063 bool read(); 00064 bool write(); 00065 00066 private: 00067 00069 // Helper functions 00070 00071 string getQualifiedFilename(); 00072 00073 00075 // Data members 00076 00080 00081 map<string, QDir> config; 00082 QString dfltScene; 00084 }; // class Configuration 00085 00086 } // namespace rtVTK 00087 00088 #endif // StandAlone_Configuration_h