SubStrings< StringType > Class Template 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< StringType >:
Collaboration diagram for SubStrings< StringType >:

Public Types

using value_type = typename std::sub_match< typename StringType::const_iterator >
 The element type. More...
 
using string_iterator = typename StringType::const_iterator
 The const_iterator for the underlying string type. More...
 

Public Member Functions

std::string::size_type length () const
 The total string length of all sub-elements. More...
 
StringType str (size_t pos) const
 Retrieve element at pos, converted to a string type. More...
 
void append (const typename StringType::const_iterator &b, const typename StringType::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...
 

Detailed Description

template<class StringType>
class Foam::SubStrings< StringType >

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

Definition at line 60 of file CStringList.H.

Member Typedef Documentation

◆ value_type

using value_type = typename std::sub_match<typename StringType::const_iterator>

The element type.

Definition at line 57 of file SubStrings.H.

◆ string_iterator

using string_iterator = typename StringType::const_iterator

The const_iterator for the underlying string type.

Definition at line 63 of file SubStrings.H.

Member Function Documentation

◆ length()

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

The total string length of all sub-elements.

Use size() for the number elements.

Definition at line 73 of file SubStrings.H.

◆ str()

StringType str ( size_t  pos) const
inline

Retrieve element at pos, converted to a string type.

Definition at line 88 of file SubStrings.H.

References Foam::pos().

Referenced by STARCDsurfaceFormatCore::readInpCellTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ append()

void append ( const typename StringType::const_iterator &  b,
const typename StringType::const_iterator &  e 
)
inline

Append sub-string defined by begin/end iterators.

Definition at line 97 of file SubStrings.H.

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

Referenced by Foam::stringOps::split(), Foam::stringOps::splitAny(), and Foam::stringOps::splitFixed().

Here is the caller graph for this function:

◆ 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 114 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 130 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 files: