JPCRE2  10.31.02
C++ wrapper for PCRE2 library
jpcre2::Modifier Class Reference

Class to take a std::string modifier value with null safety. More...

#include <jpcre2.hpp>

Public Member Functions

 Modifier ()
 Default constructor. More...
 
 Modifier (std::string const &x)
 Constructor that takes a std::string. More...
 
 Modifier (char const *x)
 Constructor that takes char const * (null safety is provided by this one) More...
 
std::string str () const
 Returns the modifier string. More...
 
char const * c_str () const
 Returns the c_str() of modifier string. More...
 
const SIZE_T length () const
 Returns the length of the modifier string. More...
 
const char operator[] (SIZE_T i) const
 operator[] overload to access character by index. More...
 

Detailed Description

Class to take a std::string modifier value with null safety.

You don't need to make an instance of this class to pass modifier, just pass std::string or char const*, whatever seems feasible, implicit conversion will kick in and take care of things for you.

Constructor & Destructor Documentation

◆ Modifier() [1/3]

jpcre2::Modifier::Modifier ( )
inline

Default constructor.

◆ Modifier() [2/3]

jpcre2::Modifier::Modifier ( std::string const &  x)
inline

Constructor that takes a std::string.

Parameters
xstd::string as a reference.

◆ Modifier() [3/3]

jpcre2::Modifier::Modifier ( char const *  x)
inline

Constructor that takes char const * (null safety is provided by this one)

Parameters
xchar const *

Member Function Documentation

◆ c_str()

char const* jpcre2::Modifier::c_str ( ) const
inline

Returns the c_str() of modifier string.

Returns
char const *

◆ length()

const SIZE_T jpcre2::Modifier::length ( ) const
inline

Returns the length of the modifier string.

Returns
length

◆ operator[]()

const char jpcre2::Modifier::operator[] ( SIZE_T  i) const
inline

operator[] overload to access character by index.

Parameters
iindex
Returns
character at index i.

◆ str()

std::string jpcre2::Modifier::str ( ) const
inline

Returns the modifier string.

Returns
modifier string (std::string)