]> Creatis software - creaImageIO.git/blob - src2/creaImageIOSettings.h
76f8214f616fc51fe6af62477ff35104c09aa028
[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
9
10 namespace creaImageIO
11 {
12     class Settings{
13     public :
14         Settings(const std::string i_path);
15         ~Settings();
16
17         //get the value for a given option
18                 const std::string getValue(const std::string i_key){return m_SettingsMap[i_key];}
19         
20                 void addDB(const std::string &i_path);
21
22                 void removeDB(const std::string &i_path);
23                 //write configuration file
24                 void writeSettingsFile();
25                 
26     private :
27                 // Settings Key-Value Map
28                 std::map<std::string, std::string> m_SettingsMap;
29                 
30                 //read the configuration file
31                 void readSettings(std::vector<std::string> &i_Keys, const std::string &i_file);
32         // create the configuration file
33         void createFile();
34                 void writeSettings(std::ofstream &o_filebuf);
35                 std::string m_SettingsFileName;
36                 
37                 
38     };
39 }