14 #include "boost/algorithm/string/case_conv.hpp"
15 #include "boost/algorithm/string/trim.hpp"
35 , m_propagateDown(true)
51 const KeySet_t::value_type& keyval( std::move(keyword_) );
60 const KeySet_t::value_type& keyval( std::move(keyword_) );
84 std::cerr <<
"MiniConfig::ReadFile(): "
85 <<
"cannot read from file: " <<
fileName <<
"\n";
101 std::istringstream linestream(
line);
104 while( linestream.get(
c) ) {
112 if(
c == 0 || isspace(
c) ) {
121 linestream.putback(
c);
126 std::cerr <<
"MiniConfig::ReadFile(): "
127 <<
"badly formatted line: \"" <<
line <<
"\", line number " << lineNumber <<
"\n";
132 if( skipCount > 0 ) {
138 std::cerr <<
"MiniConfig::ReadFile(): "
139 <<
"unmatched \"}\", line number " << lineNumber <<
"\n";
151 std::cerr <<
"MiniConfig::ReadFile(): "
152 <<
"badly formatted line: \"" <<
line <<
"\", line number " << lineNumber <<
"\n";
157 val =
line.substr(linestream.tellg(), std::string::npos);
160 if(
val.size() == 0 ) {
161 std::cerr <<
"MiniConfig::ReadFile(): "
162 <<
"badly formatted line: \"" <<
line <<
"\", line number " << lineNumber <<
"\n";
166 if( skipCount == 0 ) {
167 node->SetAttribute( att,
val,
false );
178 std::string lokey =
key;
179 boost::algorithm::to_lower (lokey);
183 std::cerr <<
"MiniConfig::ReadFile(): "
184 <<
"badly formatted line: \"" <<
line <<
"\", line number " << lineNumber <<
"\n";
195 node->SetAttribute(
id,
node->GetPathName(),
true );
204 std::cerr <<
"MiniConfig::ReadFile(): "
205 <<
"badly formatted line: \"" <<
line <<
"\", line number " << lineNumber <<
"\n";
218 std::cerr <<
"MiniConfig::GetStringAttribute(): "
219 <<
"not configured (no file has been read)\n";
220 return std::string(
"");
225 std::cerr <<
"MiniConfig::GetStringAttribute(): "
226 <<
"\"" << objName <<
"\" does not exist\n";
227 return std::string(
"");
229 return node->GetAttribute( std::move(attName) );
238 std::cerr <<
"MiniConfig::GetIntAttribute(): "
239 <<
"not configured (no file has been read)\n";
245 std::cerr <<
"MiniConfig::GetIntAttribute(): "
246 <<
"\"" << objName <<
"\" does not exist\n";
251 std::string valstring =
node->GetAttribute( attName );
252 std::istringstream valstream(valstring);
255 std::cerr <<
"MiniConfig::GetIntAttribute(): "
256 <<
"\"" << attName <<
"\" not an integer type\n";
269 std::cerr <<
"MiniConfig::GetFloatAttribute(): "
270 <<
"not configured (no file has been read)\n";
276 std::cerr <<
"MiniConfig::GetFloatAttribute(): "
277 <<
"\"" << objName <<
"\" does not exist\n";
282 std::string valstring =
node->GetAttribute( attName );
283 std::istringstream valstream(valstring);
286 std::cerr <<
"MiniConfig::GetFloatAttribute(): object \"" << objName <<
"\""
287 <<
": \"" << attName <<
"\" not a floating-point type\n";
302 std::cerr <<
"MiniConfig::GetAttributeNames(): "
303 <<
"not configured (no file has been read)\n";
309 std::cerr <<
"MiniConfig::GetAttributeNames(): "
310 <<
"\"" << objName <<
"\" does not exist\n";
314 node->GetAttributeNames( attSet );
323 std::cerr <<
"MiniConfig::SendVisitor(): "
324 <<
"not configured (no file has been read)\n";
335 std::cerr <<
"MiniConfig::SendWriter(): "
336 <<
"not configured (no file has been read)\n";