]> Creatis software - creaImageIO.git/blob - src2/creaImageIOSettings.h
add SOURCE_GROUP command to reorganize files in folder for visual studio project
[creaImageIO.git] / src2 / creaImageIOSettings.h
1 #include <boost/program_options.hpp>
2 #include <map>
3
4 #define SETTINGS_DICOM_LIBRARY "<DICOM Library>"
5 #define SETTINGS_SYNC_EVENT     "<syncro_event>"
6 #define SETTINGS_SYNC_FREQ       "<syncro_frequency>"
7 #define SETTINGS_DBPATH       "<dbpath>"
8 #define SETTINGS_COPY_PATH       "<copy_path>"
9
10
11 namespace creaImageIO
12 {
13     class Settings{
14     public :
15         Settings(const std::string i_path);
16         ~Settings();
17
18         //get the value for a given option
19                 const std::string getValue(const std::string i_key){return m_SettingsMap[i_key];}
20         
21                 void addDB(const std::string &i_path);
22
23                 void removeDB(const std::string &i_path);
24
25                 void updateSetting(const std::string& key, const std::string &val);
26         
27                 //write configuration file
28                 void writeSettingsFile();
29                 
30     private :
31                 // Settings Key-Value Map
32                 std::map<std::string, std::string> m_SettingsMap;
33                 
34                 //read the configuration file
35                 void readSettings(std::vector<std::string> &i_Keys, const std::string &i_file);
36         // create the configuration file
37         void createFile();
38                 void writeSettings(std::ofstream &o_filebuf);
39                 std::string m_SettingsFileName;
40                 
41                 
42     };
43 }