10#include "GaudiKernel/MsgStream.h"
52 const size_t pos =
m_data.find(
'#');
53 if (pos != std::string::npos)
m_data.erase(pos);
65 log << MSG::WARNING <<
"line " << std::setw(4) <<
m_line <<
" -|" <<
m_data.c_str() <<
" .. not understood!" <<
endmsg;
73 std::getline(input,
m_data);
76 if (input.eof())
m_fail =
true;
85 const size_t start =
m_data.find_first_not_of(
' ',
m_pos);
86 if (start == std::string::npos) {
90 size_t stop =
m_data.find_first_of(
' ', start + 1);
91 if (stop == std::string::npos) stop =
m_data.size();
93 if constexpr(std::is_unsigned_v<type>) {
94 unsigned long temp = std::stoul(
m_data.substr(start, stop - start),
nullptr,
m_base);
97 int temp = std::stoi(
m_data.substr(start, stop - start),
nullptr,
m_base);
106 const size_t start =
m_data.find_first_not_of(
' ',
m_pos);
107 if (start == std::string::npos) {
111 size_t stop =
m_data.find_first_of(
' ', start + 1);
112 if (stop == std::string::npos) stop =
m_data.size();
114 value =
m_data.substr(start, stop - start);
126 if (pos == std::string::npos) {
140 const size_t pos =
str.find(
'"');
141 if (pos == std::string::npos)
146 }
else if (pos ==
str.length() - 1) {
187 if (pos != std::string::npos) {
188 const size_t finalpos = pos +
token.length();
189 char prev = (pos) ?
m_data[pos - 1] :
' ';
190 char foll = (finalpos <
m_data.length()) ?
m_data[finalpos] :
' ';
191 if (prev ==
' ' && foll ==
' ')
201 const size_t pos =
str.find(
'#');
202 if (pos != std::string::npos) {
203 const std::string rep = std::to_string(t);
205 std::string new_token{
str};
206 new_token.replace(pos, rep.length(), rep);
215 const size_t pos =
str.find(
'#');
216 if (pos != std::string::npos) {
217 std::ostringstream rep;
218 rep << std::setw(2) << std::setfill(
'0') << t;
220 std::string new_token{
str};
221 new_token.replace(pos, rep.str().length(), rep.str());
282 const std::ios_base::fmtflags
fmt = f.flags() & std::ios_base::basefield;
284 case std::ios::hex:
m_base = 16;
break;
285 case std::ios::oct:
m_base = 8;
break;
298 if (pos != std::string::npos)
316 for (
int j = -1; j < i; j++) {
324 for (
int j = 0; j < i; j++) {
361 this->unsetf(std::ios::skipws | std::ios::left | std::ios::right | std::ios::internal | std::ios::oct | std::ios::hex |
362 std::ios::showbase | std::ios::showpoint | std::ios::uppercase | std::ios::scientific | std::ios::fixed |
363 std::ios::showpos | std::ios::boolalpha);
365 m_dbfmt_hex.setf(std::ios::hex, std::ios::basefield);
366 m_dbfmt_oct.setf(std::ios::oct, std::ios::basefield);
367 m_dbfmt_dec.setf(std::ios::dec, std::ios::basefield);
424 this->setf(std::ios::unitbuf | std::ios::dec);
425 this->unsetf(std::ios::skipws | std::ios::left | std::ios::right | std::ios::internal | std::ios::oct | std::ios::hex |
426 std::ios::showbase | std::ios::showpoint | std::ios::uppercase | std::ios::scientific | std::ios::fixed |
427 std::ios::showpos | std::ios::boolalpha);
DBline & operator>>(std::string &str)
enum DBline::exist_quote quote
DBline & operator+(int i)
void connect(std::ifstream &file)
quote check_quote(std::string &) const
void GoodExtraction(void)
DBline & operator<<(std::istream &input)
void GetToken(size_t pos, std::string_view token)
std::ios::fmtflags m_default
void GetStr(std::string &)
void GetValue(type &value)
void go_until(std::string_view token)
DBline & operator()(std::string_view)
DBline & token(std::string_view)
void GetLine(std::istream &input)
DBstatus operator&(DBstatus s1, DBstatus s2)
DBstatus operator|(DBstatus s1, DBstatus s2)
std::ifstream & operator>>(std::ifstream &file, DBline &db)
std::ostream & operator<<(std::ostream &stream, DBline &db)
enum result_extraction DBstatus
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)