21 #define THE_INI m_impl->m_ini
34 THE_INI.Load(aux.c_str(), aux.size());
41 THE_INI.Load(str.c_str(), str.size());
57 THE_INI.Load(aux.c_str(), aux.size());
62 THE_INI.Load(str.c_str(), str.size());
72 const std::string& section,
const std::string& name,
const std::string& str)
77 THE_INI.SetValue(section.c_str(), name.c_str(), str.c_str(),
nullptr);
78 if (ret < 0)
THROW_EXCEPTION(
"Error changing value in INI-style file!");
84 const std::string& section,
const std::string& name,
85 const std::string& defaultStr,
bool failIfNotFound)
const
88 const char* defVal = failIfNotFound ? nullptr : defaultStr.c_str();
90 const char* aux =
m_impl->m_ini.GetValue(
91 section.c_str(), name.c_str(), defVal,
94 if (failIfNotFound && !aux)
97 "Value '%s' not found in section '%s' of memory configuration "
98 "string list and failIfNotFound=true.",
99 name.c_str(), section.c_str()));
104 std::string ret = aux;
106 if ((pos = ret.find(
"//")) != string::npos && pos > 0 &&
107 isspace(ret[pos - 1]))
108 ret = ret.substr(0, pos);
118 MRPT_CSimpleIni::TNamesDepend::iterator n;
119 std::vector<std::string>::iterator s;
120 sections.resize(
names.size());
121 for (n =
names.begin(), s = sections.begin(); n !=
names.end(); ++n, ++s)
126 const string& section, std::vector<std::string>& keys)
const
131 MRPT_CSimpleIni::TNamesDepend::iterator n;
132 std::vector<std::string>::iterator s;
133 keys.resize(
names.size());
134 for (n =
names.begin(), s = keys.begin(); n !=
names.end(); ++n, ++s)