#include <dbline.h>
Definition at line 255 of file dbline.h.
◆ quote
◆ exist_quote
| Enumerator |
|---|
| no_quote | |
| begin_quote | |
| end_quote | |
| error | |
Definition at line 257 of file dbline.h.
enum DBline::exist_quote quote
◆ DBline() [1/3]
Definition at line 360 of file dbline.cxx.
360 {
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);
368}
std::ios::fmtflags m_default
◆ DBline() [2/3]
| DBline::DBline |
( |
std::ifstream & | file | ) |
|
◆ DBline() [3/3]
| DBline::DBline |
( |
std::istream & | stream | ) |
|
◆ BadExtraction()
| void DBline::BadExtraction |
( |
void | | ) |
|
|
private |
◆ check_data()
| bool DBline::check_data |
( |
void | | ) |
|
|
inlineprivate |
◆ check_quote()
Definition at line 139 of file dbline.cxx.
139 {
140 const size_t pos =
str.find(
'"');
141 if (pos == std::string::npos)
143 else if (pos == 0) {
146 }
else if (pos ==
str.length() - 1) {
149 }
151}
◆ connect() [1/2]
| void DBline::connect |
( |
std::ifstream & | file | ) |
|
◆ connect() [2/2]
| void DBline::connect |
( |
std::istream & | stream | ) |
|
◆ dbdec()
| const DBfmt & DBline::dbdec |
( |
| ) |
const |
|
inline |
◆ dbhex()
| const DBfmt & DBline::dbhex |
( |
| ) |
const |
|
inline |
◆ dboct()
| const DBfmt & DBline::dboct |
( |
| ) |
const |
|
inline |
◆ empty()
| bool DBline::empty |
( |
void | | ) |
const |
|
inline |
◆ erase_comment()
| void DBline::erase_comment |
( |
void | | ) |
|
|
private |
Definition at line 51 of file dbline.cxx.
51 {
53 if (pos != std::string::npos)
m_data.erase(pos);
54}
◆ GetLine()
| void DBline::GetLine |
( |
std::istream & | input | ) |
|
|
private |
Definition at line 62 of file dbline.cxx.
62 {
65 log << MSG::WARNING <<
"line " << std::setw(4) <<
m_line <<
" -|" <<
m_data.c_str() <<
" .. not understood!" <<
endmsg;
66 }
70 return;
71 }
73 std::getline(input,
m_data);
77}
IMessageSvc * getMessageSvc(bool quiet=false)
◆ GetStr()
| void DBline::GetStr |
( |
std::string & | str | ) |
|
|
private |
Definition at line 120 of file dbline.cxx.
120 {
126 if (pos == std::string::npos) {
129 return;
130 }
133 } else {
136 }
137}
quote check_quote(std::string &) const
void GetValue(type &value)
◆ GetToken()
| void DBline::GetToken |
( |
size_t | pos, |
|
|
std::string_view | token ) |
|
private |
Definition at line 56 of file dbline.cxx.
56 {
60}
void GoodExtraction(void)
DBline & token(std::string_view)
◆ GetValue() [1/2]
| void DBline::GetValue |
( |
std::string & | value | ) |
|
|
private |
Definition at line 104 of file dbline.cxx.
104 {
107 if (start == std::string::npos) {
109 return;
110 }
111 size_t stop =
m_data.find_first_of(
' ', start + 1);
112 if (stop == std::string::npos)
stop =
m_data.size();
113
115
118}
◆ GetValue() [2/2]
| void DBline::GetValue |
( |
type & | value | ) |
|
|
private |
Definition at line 83 of file dbline.cxx.
83 {
86 if (start == std::string::npos) {
88 return;
89 }
90 size_t stop =
m_data.find_first_of(
' ', start + 1);
91 if (stop == std::string::npos)
stop =
m_data.size();
92
93 if constexpr(std::is_unsigned_v<type>) {
94 unsigned long temp = std::stoul(
m_data.substr(start, stop - start),
nullptr,
m_base);
96 } else {
97 int temp = std::stoi(
m_data.substr(start, stop - start),
nullptr,
m_base);
99 }
102}
◆ go_until()
| void DBline::go_until |
( |
std::string_view | token | ) |
|
Definition at line 229 of file dbline.cxx.
229 {
236}
void GetLine(std::istream &input)
◆ GoodExtraction()
| void DBline::GoodExtraction |
( |
void | | ) |
|
|
private |
◆ operator bool()
| DBline::operator bool |
( |
| ) |
|
◆ operator DBstatus()
◆ operator!()
| bool DBline::operator! |
( |
| ) |
|
◆ operator()() [1/3]
| DBline & DBline::operator() |
( |
std::string_view | str | ) |
|
Definition at line 343 of file dbline.cxx.
343 {
345 return *this;
346}
◆ operator()() [2/3]
| DBline & DBline::operator() |
( |
std::string_view | str, |
|
|
int | n ) |
Definition at line 348 of file dbline.cxx.
348 {
350 return *this;
351}
◆ operator()() [3/3]
| DBline & DBline::operator() |
( |
std::string_view | str, |
|
|
int | n, |
|
|
int | s ) |
Definition at line 353 of file dbline.cxx.
353 {
355 return *this;
356}
◆ operator+()
| DBline & DBline::operator+ |
( |
int | i | ) |
|
Definition at line 323 of file dbline.cxx.
323 {
324 for (
int j = 0; j <
i; j++) {
327 }
328 return *this;
329}
◆ operator++() [1/2]
| DBline & DBline::operator++ |
( |
| ) |
|
Definition at line 309 of file dbline.cxx.
309 {
312 return *this;
313}
◆ operator++() [2/2]
| DBline & DBline::operator++ |
( |
int | i | ) |
|
Definition at line 315 of file dbline.cxx.
315 {
316 for (
int j = -1; j <
i; j++) {
319 }
320 return *this;
321}
◆ operator<<() [1/2]
| DBline & DBline::operator<< |
( |
std::ifstream & | file | ) |
|
Definition at line 380 of file dbline.cxx.
380 {
383 return *this;
384}
void connect(std::ifstream &file)
◆ operator<<() [2/2]
| DBline & DBline::operator<< |
( |
std::istream & | input | ) |
|
Definition at line 386 of file dbline.cxx.
386 {
389 return *this;
390}
◆ operator>>() [1/8]
Definition at line 280 of file dbline.cxx.
280 {
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;
287 }
288 return *this;
289}
◆ operator>>() [2/8]
| DBline & DBline::operator>> |
( |
int & | i | ) |
|
Definition at line 255 of file dbline.cxx.
255 {
257 return *this;
258}
◆ operator>>() [3/8]
| DBline & DBline::operator>> |
( |
std::string & | str | ) |
|
Definition at line 251 of file dbline.cxx.
251 {
253 return *this;
254}
void GetStr(std::string &)
◆ operator>>() [4/8]
| DBline & DBline::operator>> |
( |
std::string_view | token | ) |
|
Definition at line 295 of file dbline.cxx.
295 {
298 if (pos != std::string::npos)
300 else
302 return *this;
303}
void GetToken(size_t pos, std::string_view token)
◆ operator>>() [5/8]
| DBline & DBline::operator>> |
( |
uint16_t & | i16 | ) |
|
Definition at line 263 of file dbline.cxx.
263 {
265 return *this;
266}
◆ operator>>() [6/8]
| DBline & DBline::operator>> |
( |
uint32_t & | i32 | ) |
|
Definition at line 267 of file dbline.cxx.
267 {
269 return *this;
270}
◆ operator>>() [7/8]
| DBline & DBline::operator>> |
( |
uint64_t & | i64 | ) |
|
Definition at line 271 of file dbline.cxx.
271 {
273 return *this;
274}
◆ operator>>() [8/8]
| DBline & DBline::operator>> |
( |
uint8_t & | i8 | ) |
|
Definition at line 259 of file dbline.cxx.
259 {
261 return *this;
262}
◆ reset()
| void DBline::reset |
( |
void | | ) |
|
|
private |
◆ reset_data()
| void DBline::reset_data |
( |
void | | ) |
|
|
private |
◆ reset_fmt()
| DBline & DBline::reset_fmt |
( |
void | | ) |
|
Definition at line 241 of file dbline.cxx.
241 {
244 return *this;
245}
◆ reset_status()
| void DBline::reset_status |
( |
void | | ) |
|
|
private |
◆ token() [1/3]
| DBline & DBline::token |
( |
std::string_view | token | ) |
|
Definition at line 179 of file dbline.cxx.
179 {
183 return *this;
184 }
186
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 == ' ')
193 else
195 } else
197 return *this;
198}
◆ token() [2/3]
| DBline & DBline::token |
( |
std::string_view | str, |
|
|
type | t ) |
Definition at line 200 of file dbline.cxx.
200 {
201 const size_t pos =
str.find(
'#');
202 if (pos != std::string::npos) {
203 const std::string
rep = std::to_string(t);
204
205 std::string new_token{
str};
206 new_token.replace(pos,
rep.length(), rep);
208 } else
210
211 return *this;
212}
◆ token() [3/3]
| DBline & DBline::token |
( |
std::string_view | str, |
|
|
type | t, |
|
|
int | size ) |
Definition at line 214 of file dbline.cxx.
214 {
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;
219
220 std::string new_token{
str};
221 new_token.replace(pos,
rep.str().length(),
rep.str());
223 } else
225
226 return *this;
227}
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | stream, |
|
|
DBline & | db ) |
|
friend |
◆ operator>> [1/2]
| std::ifstream & operator>> |
( |
std::ifstream & | file, |
|
|
DBline & | db ) |
|
friend |
◆ operator>> [2/2]
| std::istream & operator>> |
( |
std::istream & | stream, |
|
|
DBline & | db ) |
|
friend |
◆ m_backup
| std::string DBline::m_backup |
|
private |
◆ m_base
◆ m_data
| std::string DBline::m_data |
|
private |
◆ m_dbfmt_dec
| DBfmt DBline::m_dbfmt_dec |
|
private |
◆ m_dbfmt_hex
| DBfmt DBline::m_dbfmt_hex |
|
private |
◆ m_dbfmt_oct
| DBfmt DBline::m_dbfmt_oct |
|
private |
◆ m_default
| std::ios::fmtflags DBline::m_default |
|
private |
◆ m_empty
| bool DBline::m_empty {false} |
|
private |
◆ m_extraction
◆ m_fail
| bool DBline::m_fail {false} |
|
private |
◆ m_file
| std::ifstream* DBline::m_file {nullptr} |
|
private |
◆ m_line
◆ m_pos
| unsigned long int DBline::m_pos {0} |
|
private |
◆ m_stream
| std::istream* DBline::m_stream {nullptr} |
|
private |
The documentation for this class was generated from the following files: