creaImageIOSettings.h

Go to the documentation of this file.
00001 #include <boost/program_options.hpp>
00002 #include <map>
00003 
00004 #define SETTINGS_DICOM_LIBRARY "<DICOM Library>"
00005 #define SETTINGS_SYNC_EVENT     "<syncro_event>"
00006 #define SETTINGS_SYNC_FREQ       "<syncro_frequency>"
00007 #define SETTINGS_DBPATH       "<dbpath>"
00008 #define SETTINGS_COPY_PATH       "<copy_path>"
00009 
00010 
00011 namespace creaImageIO
00012 {
00013     class Settings{
00014     public :
00015         Settings(const std::string i_path);
00016         ~Settings();
00017 
00018         //get the value for a given option
00019                 const std::string getValue(const std::string i_key){return m_SettingsMap[i_key];}
00020         
00021                 void addDB(const std::string &i_path);
00022 
00023                 void removeDB(const std::string &i_path);
00024 
00025                 void updateSetting(const std::string& key, const std::string &val);
00026         
00027                 //write configuration file
00028                 void writeSettingsFile();
00029                 
00030     private :
00031                 // Settings Key-Value Map
00032                 std::map<std::string, std::string> m_SettingsMap;
00033                 
00034                 //read the configuration file
00035                 void readSettings(std::vector<std::string> &i_Keys, const std::string &i_file);
00036         // create the configuration file
00037         void createFile();
00038                 void writeSettings(std::ofstream &o_filebuf);
00039                 std::string m_SettingsFileName;
00040                 
00041                 
00042     };
00043 }

Generated on Mon Jun 22 10:49:30 2009 for CreaImageIO by  doxygen 1.5.3