4 #pragma GCC diagnostic push
5 #pragma GCC diagnostic ignored "-Wshadow"
6 #include <boost/stacktrace.hpp>
7 #pragma GCC diagnostic pop
17 std::map<std::string, std::string>::const_iterator iter =
m_StringFlagMap.find(name);
22 std::cout <<
"PHFlag::getString: ERROR Unknown character Flag " << name << std::endl;
24 std::cout <<
"The following flags are implemented: " << std::endl;
32 std::map<std::string, std::string>::const_iterator iter =
m_StringFlagMap.find(name);
52 std::map<std::string, double>::const_iterator iter =
m_DoubleFlagMap.find(name);
57 std::cout <<
"PHFlag::getFlag: ERROR Unknown Double Flag " << name << std::endl;
59 std::cout <<
"The following flags are implemented: " << std::endl;
66 std::map<std::string, double>::const_iterator iter =
m_DoubleFlagMap.find(name);
86 std::map<std::string, float>::const_iterator iter =
m_FloatFlagMap.find(name);
91 std::cout <<
"PHFlag::getFlag: ERROR Unknown Float Flag " << name << std::endl;
93 std::cout <<
"The following flags are implemented: " << std::endl;
100 std::map<std::string, float>::const_iterator iter =
m_FloatFlagMap.find(name);
120 std::map<std::string, int>::const_iterator iter =
m_IntFlagMap.find(name);
125 std::cout <<
"PHFlag::getFlag: ERROR Unknown Int Flag " << name << std::endl;
127 std::cout <<
"The following flags are implemented: " << std::endl;
134 std::map<std::string, int>::const_iterator iter =
m_IntFlagMap.find(name);
154 std::map<std::string, uint64_t>::const_iterator iter =
m_UInt64FlagMap.find(name);
159 std::cout <<
"PHFlag::getFlag: ERROR Unknown uint64 Flag " << name << std::endl;
161 std::cout <<
"The following flags are implemented: " << std::endl;
168 std::map<std::string, uint64_t>::const_iterator iter =
m_UInt64FlagMap.find(name);
199 std::cout << std::endl
200 <<
"Integer Flags:" << std::endl;
201 std::map<std::string, int>::const_iterator intiter;
204 std::cout << intiter->first <<
" is " << intiter->second << std::endl;
212 std::cout << std::endl
213 <<
"uint64 Flags:" << std::endl;
214 std::map<std::string, uint64_t>::const_iterator intiter;
217 std::cout << intiter->first <<
" is " << intiter->second << std::endl;
225 std::cout << std::endl
226 <<
"Double Flags:" << std::endl;
227 std::map<std::string, double>::const_iterator doubleiter;
230 std::cout << doubleiter->first <<
" is " << doubleiter->second << std::endl;
238 std::cout << std::endl
239 <<
"Float Flags:" << std::endl;
240 std::map<std::string, float>::const_iterator floatiter;
243 std::cout << floatiter->first <<
" is " << floatiter->second << std::endl;
251 std::cout << std::endl
252 <<
"String Flags:" << std::endl;
253 std::map<std::string, std::string>::const_iterator chariter;
256 std::cout << chariter->first <<
" is " << chariter->second << std::endl;
263 std::map<std::string, int>::const_iterator iter =
m_IntFlagMap.find(name);
268 std::map<std::string, uint64_t>::const_iterator uiter =
m_UInt64FlagMap.find(name);
273 std::map<std::string, float>::const_iterator fiter =
m_FloatFlagMap.find(name);
278 std::map<std::string, double>::const_iterator diter =
m_DoubleFlagMap.find(name);
283 std::map<std::string, std::string>::const_iterator citer =
m_StringFlagMap.find(name);
300 uint64_t uivalue = 0;
301 int uivaluecount = 0;
307 std::ifstream
infile(name);
308 while (infile >> label)
310 std::cout <<
"Label " <<
label;
311 if (label.substr(0, 1) ==
"S")
316 std::cout <<
" type S read " << cvalue << std::endl;
318 else if (label.substr(0, 1) ==
"F")
323 std::cout <<
" type F read " << fvalue << std::endl;
325 else if (label.substr(0, 1) ==
"D")
330 std::cout <<
" type D read " << dvalue << std::endl;
332 else if (label.substr(0, 1) ==
"I")
336 set_IntFlag(label.substr(1, label.size() - 1), ivalue);
337 std::cout <<
" type I read " << ivalue << std::endl;
339 else if (label.substr(0, 1) ==
"U")
344 std::cout <<
" type U read " << uivalue << std::endl;
350 std::cout <<
" Junk read " << junk << std::endl;
354 std::cout <<
"Read StringFlags(" << cvaluecount
355 <<
") FloatFlags(" << fvaluecount
356 <<
") DoubleFlags(" << dvaluecount
357 <<
") IntFlags(" << ivaluecount
358 <<
") uint64Flags(" << uivaluecount
359 <<
") JunkEntries(" << junkcount
360 <<
") from file " << name << std::endl;
367 std::ofstream outFile(name);
369 std::map<std::string, int>::const_iterator intiter;
372 outFile <<
"I" << intiter->first <<
"\t" << intiter->second << std::endl;
375 std::map<std::string, uint64_t>::const_iterator uintiter;
378 outFile <<
"U" << uintiter->first <<
"\t" << uintiter->second << std::endl;
381 std::map<std::string, float>::const_iterator floatiter;
384 outFile <<
"F" << floatiter->first <<
"\t" << floatiter->second << std::endl;
387 int oldprecision = outFile.precision(15);
388 std::map<std::string, double>::const_iterator doubleiter;
391 outFile <<
"D" << doubleiter->first <<
"\t" << doubleiter->second << std::endl;
393 outFile.precision(oldprecision);
395 std::map<std::string, std::string>::const_iterator chariter;
398 outFile <<
"S" << chariter->first <<
"\t" << chariter->second << std::endl;
406 std::cout <<
"Called by #3 or #4 in this list: " << std::endl;
407 std::cout << boost::stacktrace::stacktrace();
408 std::cout << std::endl;
409 std::cout <<
"DO NOT PANIC - this is not a segfault" << std::endl;
414 std::map<std::string, int>::iterator iter =
m_IntFlagMap.find(name);
419 std::map<std::string, uint64_t>::iterator uiter =
m_UInt64FlagMap.find(name);
424 std::map<std::string, double>::iterator diter =
m_DoubleFlagMap.find(name);
429 std::map<std::string, float>::iterator fiter =
m_FloatFlagMap.find(name);
434 std::map<std::string, std::string>::iterator citer =
m_StringFlagMap.find(name);