Sub-ranges of a string with a structure similar to std::match_results, but without the underlying regular expression matching. More...
#include <SubStrings.H>


Public Member Functions | |
| std::string::size_type | length () const |
| The total string length of all sub-elements. | |
| std::string::size_type | length (size_t pos) const |
| Return length of element at pos. | |
| 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. | |
| void | append (std::string::const_iterator b, std::string::const_iterator e) |
| Append sub-string defined by begin/end iterators. | |
| void | pop_back (size_t n=1) |
| Reduce size by 1 or more elements. Can be called on an empty list. | |
| void | pop_front (size_t n=1) |
| Reduce size by 1 or more elements (from the front). Can be called on an empty list. | |
Static Public Member Functions | |
| static std::string_view | view (const std::ssub_match &m) |
| Return match as a string_view. | |
Sub-ranges of a string with a structure similar to std::match_results, but without the underlying regular expression matching.
Definition at line 46 of file SubStrings.H.
|
inlinestatic |
Return match as a string_view.
Definition at line 57 of file SubStrings.H.
Referenced by view().

|
inline |
The total string length of all sub-elements.
Use size() for the number elements.
Definition at line 81 of file SubStrings.H.
|
inline |
Return length of element at pos.
Definition at line 96 of file SubStrings.H.
References Foam::pos().

|
inline |
Retrieve element at pos, as a string.
Definition at line 104 of file SubStrings.H.
References Foam::pos().

|
inline |
Return element at pos as a string_view.
Definition at line 112 of file SubStrings.H.
References Foam::pos(), and view().

|
inline |
Append sub-string defined by begin/end iterators.
Definition at line 120 of file SubStrings.H.
|
inline |
Reduce size by 1 or more elements. Can be called on an empty list.
Definition at line 135 of file SubStrings.H.
References clear(), n, and resize().

|
inline |
Reduce size by 1 or more elements (from the front). Can be called on an empty list.
Definition at line 151 of file SubStrings.H.
References clear(), n, and resize().
