Definition at line 48 of file PhreeqcIO.cpp.
◆ StringViewLineIterator()
| ChemistryLib::PhreeqcIOData::anonymous_namespace{PhreeqcIO.cpp}::StringViewLineIterator::StringViewLineIterator |
( |
std::string_view | text, |
|
|
std::size_t | pos = 0 ) |
|
inline |
◆ getline()
| bool ChemistryLib::PhreeqcIOData::anonymous_namespace{PhreeqcIO.cpp}::StringViewLineIterator::getline |
( |
std::string_view & | line | ) |
|
|
inline |
Definition at line 56 of file PhreeqcIO.cpp.
57 {
59 {
60 return false;
61 }
62
63 if (
const auto newline_pos =
text_.find(
'\n',
pos_);
64 newline_pos == std::string_view::npos)
65 {
68 }
69 else
70 {
72 pos_ = newline_pos + 1;
73 }
74
75
76 if (!line.empty() && line.back() == '\r')
77 {
78 line.remove_suffix(1);
79 }
80
81 return true;
82 }
References pos_, and text_.
◆ skip()
| void ChemistryLib::PhreeqcIOData::anonymous_namespace{PhreeqcIO.cpp}::StringViewLineIterator::skip |
( |
int | num_lines | ) |
|
|
inline |
Definition at line 84 of file PhreeqcIO.cpp.
85 {
86 for (
int i = 0; i < num_lines &&
pos_ <
text_.size(); ++i)
87 {
88 const auto newline_pos =
text_.find(
'\n',
pos_);
89 pos_ = (newline_pos == std::string_view::npos) ?
text_.size()
90 : newline_pos + 1;
91 }
92 }
References pos_, and text_.
◆ pos_
| std::size_t ChemistryLib::PhreeqcIOData::anonymous_namespace{PhreeqcIO.cpp}::StringViewLineIterator::pos_ |
|
private |
◆ text_
| std::string_view ChemistryLib::PhreeqcIOData::anonymous_namespace{PhreeqcIO.cpp}::StringViewLineIterator::text_ |
|
private |
The documentation for this class was generated from the following file: