29 #include <gmapping/configfile/configfile_export.h>
33 class CONFIGFILE_EXPORT AutoVal {
36 explicit AutoVal(
const std::string&);
37 explicit AutoVal(
double);
38 explicit AutoVal(
int);
39 explicit AutoVal(
unsigned int);
40 explicit AutoVal(
bool);
41 explicit AutoVal(
const char*);
43 AutoVal(
const AutoVal&);
44 AutoVal& operator=(
const AutoVal&);
46 AutoVal& operator=(
double);
47 AutoVal& operator=(
int);
48 AutoVal& operator=(
unsigned int);
49 AutoVal& operator=(
bool);
50 AutoVal& operator=(
const std::string&);
53 operator std::string()
const;
54 operator double()
const;
56 operator unsigned int()
const;
57 operator bool()
const;
60 std::string toLower(
const std::string& source)
const;
67 std::map<std::string,AutoVal> m_content;
74 bool read(
const std::string& configFile);
75 bool read(
const char* configFile);
78 const AutoVal& value(
const std::string& section,
79 const std::string& entry)
const;
81 const AutoVal& value(
const std::string& section,
82 const std::string& entry,
85 const AutoVal& value(
const std::string& section,
86 const std::string& entry,
89 const AutoVal& value(
const std::string& section,
90 const std::string& entry,
93 const AutoVal& value(
const std::string& section,
94 const std::string& entry,
97 const AutoVal& value(
const std::string& section,
98 const std::string& entry,
101 const AutoVal& value(
const std::string& section,
102 const std::string& entry,
103 const std::string& def);
105 void dumpValues(std::ostream& out);
109 std::string trim(
const std::string& source,
char const* delims =
" \t\r\n")
const;
110 std::string truncate(
const std::string& source,
const char* atChar)
const;
111 std::string toLower(
const std::string& source)
const;
112 void insertValue(
const std::string& section,
const std::string& entry,
const std::string& thevalue );