Loading...
Searching...
No Matches
SubStrings Class Reference

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

#include <SubStrings.H>

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.
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.

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 46 of file SubStrings.H.

Member Function Documentation

◆ view() [1/2]

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

Return match as a string_view.

Definition at line 57 of file SubStrings.H.

Referenced by 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 81 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 96 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 104 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 112 of file SubStrings.H.

References Foam::pos(), and 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 b, 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 135 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 151 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: