35#ifndef Foam_SubStrings_H
36#define Foam_SubStrings_H
55 public std::vector<std::ssub_match>
62 static std::string_view
view(
const std::ssub_match& m)
64 if (!m.matched)
return std::string_view();
66 #if __cplusplus >= 202002L
67 return std::string_view(m.first, m.second);
70 return std::string_view
72 std::pointer_traits<const char*>::pointer_to(*(m.first)),
83 std::string::size_type
length()
const
85 std::string::size_type len = 0;
87 for (
const auto& elem : *
this)
98 return (*
this)[
pos].length();
102 std::string
str(
size_t pos)
const
104 return (*
this)[
pos].str();
108 std::string_view
view(
size_t pos)
const
116 std::string::const_iterator
b,
117 std::string::const_iterator
e
123 range.matched =
true;
129 if (
n >= this->size())
143 if (
n >= this->size())
150 for (
size_t src =
n, dst = 0; src < this->size(); ++src, ++dst)
152 (*this)[dst] = (*this)[src];
154 this->
resize(this->size() -
n);
Sub-ranges of a string with a structure similar to std::match_results, but without the underlying reg...
void pop_back(size_t n=1)
Reduce size by 1 or more elements. Can be called on an empty list.
std::string::size_type length(size_t pos) const
Return length of element at pos.
void pop_front(size_t n=1)
Reduce size by 1 or more elements (from the front). Can be called on an empty list.
std::string::size_type length() const
The total string length of all sub-elements.
static std::string_view view(const std::ssub_match &m)
Return match as a string_view.
void append(std::string::const_iterator b, std::string::const_iterator e)
Append sub-string defined by begin/end iterators.
std::string str(size_t pos) const
Retrieve element at pos, as a string.
std::string_view view(size_t pos) const
Return element at pos as a string_view.
patchWriters resize(patchIds.size())
dimensionedScalar pos(const dimensionedScalar &ds)