Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Properties.h
Go to the documentation of this file.
1 
12 #ifndef __KOME_CORE_PROPERTIES_H__
13 #define __KOME_CORE_PROPERTIES_H__
14 
15 
16 #include <string>
17 #include <vector>
18 #include <utility>
19 #include <boost/function.hpp>
20 
21 
22 namespace kome {
23  namespace core {
24 
29  class CORE_TOOLKITS_CLASS Properties {
30  public:
35  Properties();
36 
41  virtual ~Properties();
42 
43  protected:
45  std::vector< std::pair< std::string, std::string > > m_props;
46 
47  public:
54  void setValue( const char* key, const char* value );
55 
62  void setIntValue( const char* key, int value );
63 
70  void setDoubleValue( const char* key, double value );
71 
78  void setBoolValue( const char* key, bool value );
79 
87  void setIntValues( const char* key, int* values, int size );
88 
95  bool hasKey( const char* key );
96 
105  const char* getStringValue( const char* key, const char* defaultValue );
106 
115  int getIntValue( const char* key, int defaultValue );
116 
125  double getDoubleValue( const char* key, double defaultValue );
126 
135  bool getBoolValue( const char* key, bool defaultValue );
136 
143  void getIntValues(const char* key, std::vector<int> &values);
144 
150  unsigned int getNumberOfProperties();
151 
158  const char* getKey( const unsigned int index );
159 
166  const char* getValue( const unsigned int index );
167 
173  void deleteParameter( const char* key );
174 
188  std::string replaceString(
189  const char* s,
190  const char* prefix,
191  const char* suffix,
192  const char* defaultString
193  );
194  };
195  }
196 }
197 
198 #endif // __KOME_CORE_Properties_H__
std::vector< std::pair< std::string, std::string > > m_props
Definition: Properties.h:45
keys and values management class
Definition: Properties.h:29