41 #ifndef _ParameterFile_H
42 #define _ParameterFile_H
76 void _set(std::string parameter, std::string value);
81 inline void _toLower(std::string& input)
const;
92 std::map<std::string, std::string>
_params;
121 explicit IoError(
const std::string& msg);
129 explicit Unset(
const std::string& msg);
146 static std::string parName(std::string fullName);
152 static std::string objName(std::string fullName);
156 void setDelimiter(
char delimiter);
160 void setConvertSlashes(
bool convertSlashes);
165 bool isSet(std::string parameter)
const;
171 void set(std::string parameter,
const T& value = T());
178 void set(std::string parameter,
const std::vector<T>& value);
186 T
get(std::string parameter)
const;
193 T
get(std::string parameter, T defaultValue);
203 std::vector<T> getList(std::string parameter)
const;
212 inline std::vector<T> getList(
213 std::string parameter, std::string defaultValue);
220 std::vector<std::string> getKeyList(std::string beginsWith =
"")
const;
232 std::vector<std::string> getEveryParameter(
const std::string& param)
const;
235 void showSetParams()
const;
245 void erase(std::string parameter);
249 void resetSetParams();
253 void setNotFoundWarningsOn(
bool noFoundWarnings);
260 bool save(std::string fileName)
const;
266 bool load(std::string fileName);
270 void toStream(std::ostream &strm)
const;
274 void fromStream(std::istream& strm);
277 #endif // _ParameterFile_H
std::map< std::string, std::string > _params
maps parameters to their respective values
#define charon_DEPRECATED
handle deprecated messages on GCC and MSVC
This class serves to store parameters used within the Charon Project.
Exception thrown when trying to access unset parameters.
std::map< std::string, std::string > _setParams
stores modified and new parameters in a seperate map (see showSetParams())
bool _convertSlashes
convert linux to windows slashes and vice versa (depends on define CHARON_LINUX/CHARON_WINDOWS in Str...
std::vector< std::string > _parameterLines
this vector keeps a copy of all parameters in order to preserve their ordering in the actual file it ...
char _delimiter
delimiter for lists of values (default is ';')
#define charon_core_DLL_PUBLIC
Preprocessor macro to define this class/function as public visible, i.e.
I/O error exception thrown by ParameterFile instances.
Dynamic library API import/export prprocessor macros.
bool _noFoundWarnings
warn if parameter was not found