SubStrings Class Reference

Sub-ranges of a string with a structure similar to std::match_results, but without the underlying regular expression matching. More...

Inheritance diagram for SubStrings:
Collaboration diagram for SubStrings:

Public Member Functions

std::string::size_type length () const
 The total string length of all sub-elements. More...
 
std::string::size_type length (size_t pos) const
 Return length of element at pos. More...
 
std::string str (size_t pos) const
 Retrieve element at pos, as a string. More...
 
std::string_view view (size_t pos) const
 Return element at pos as a string_view. More...
 
void append (std::string::const_iterator b, std::string::const_iterator e)
 Append sub-string defined by begin/end iterators. More...
 
void pop_back (size_t n=1)
 Reduce size by 1 or more elements. Can be called on an empty list. More...
 
void pop_front (size_t n=1)
 Reduce size by 1 or more elements (from the front). Can be called on an empty list. More...
 

Static Public Member Functions

static std::string_view view (const std::ssub_match &m)
 Return match as a string_view. More...
 

Detailed Description

Sub-ranges of a string with a structure similar to std::match_results, but without the underlying regular expression matching.

Definition at line 45 of file SubStrings.H.

Member Function Documentation

◆ view() [1/2]

static std::string_view view ( const std::ssub_match &  m)
inlinestatic

Return match as a string_view.

Definition at line 56 of file SubStrings.H.

Referenced by SubStrings::view().

Here is the caller graph for this function:

◆ length() [1/2]

std::string::size_type length ( ) const
inline

The total string length of all sub-elements.

Use size() for the number elements.

Definition at line 80 of file SubStrings.H.

◆ length() [2/2]

std::string::size_type length ( size_t  pos) const
inline

Return length of element at pos.

Definition at line 95 of file SubStrings.H.

References Foam::pos().

Here is the call graph for this function:

◆ str()

std::string str ( size_t  pos) const
inline

Retrieve element at pos, as a string.

Definition at line 103 of file SubStrings.H.

References Foam::pos().

Here is the call graph for this function:

◆ view() [2/2]

std::string_view view ( size_t  pos) const
inline

Return element at pos as a string_view.

Definition at line 111 of file SubStrings.H.

References Foam::pos(), and SubStrings::view().

Here is the call graph for this function:

◆ append()

void append ( std::string::const_iterator  b,
std::string::const_iterator  e 
)
inline

Append sub-string defined by begin/end iterators.

Definition at line 120 of file SubStrings.H.

References Foam::constant::physicoChemical::b, Foam::constant::electromagnetic::e, and range.

◆ pop_back()

void pop_back ( size_t  n = 1)
inline

Reduce size by 1 or more elements. Can be called on an empty list.

Definition at line 134 of file SubStrings.H.

References clear(), n, and resize().

Here is the call graph for this function:

◆ pop_front()

void pop_front ( size_t  n = 1)
inline

Reduce size by 1 or more elements (from the front). Can be called on an empty list.

Definition at line 150 of file SubStrings.H.

References clear(), n, and resize().

Here is the call graph for this function:

The documentation for this class was generated from the following file: