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

Lets you create custom modifier tables. More...

#include <jpcre2.hpp>

Public Member Functions

 ModifierTable ()
 Default constructor that creates an empty modifier table. More...
 
 ModifierTable (bool deflt)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
ModifierTableresetMatchModifierTable ()
 Reset the match modifier table to its initial (empty) state including memory. More...
 
ModifierTableresetReplaceModifierTable ()
 Reset the replace modifier table to its initial (empty) state including memory. More...
 
ModifierTableresetCompileModifierTable ()
 Reset the compile modifier table to its initial (empty) state including memory. More...
 
ModifierTablereset ()
 Reset the modifier tables to their initial (empty) state including memory. More...
 
ModifierTableclearMatchModifierTable ()
 Clear the match modifier table to its initial (empty) state. More...
 
ModifierTableclearReplaceModifierTable ()
 Clear the replace modifier table to its initial (empty) state. More...
 
ModifierTableclearCompileModifierTable ()
 Clear the compile modifier table to its initial (empty) state. More...
 
ModifierTableclear ()
 Clear the modifier tables to their initial (empty) state. More...
 
void toMatchOption (Modifier const &mod, bool x, Uint *po, Uint *jo, int *en, SIZE_T *eo) const
 Modifier parser for match related options. More...
 
void toReplaceOption (Modifier const &mod, bool x, Uint *po, Uint *jo, int *en, SIZE_T *eo) const
 Modifier parser for replace related options. More...
 
void toCompileOption (Modifier const &mod, bool x, Uint *po, Uint *jo, int *en, SIZE_T *eo) const
 Modifier parser for compile related options. More...
 
std::string fromMatchOption (Uint po, Uint jo) const
 Take match related option value and convert to modifier string. More...
 
std::string fromReplaceOption (Uint po, Uint jo) const
 Take replace related option value and convert to modifier string. More...
 
std::string fromCompileOption (Uint po, Uint jo) const
 Take compile related option value and convert to modifier string. More...
 
ModifierTablesetMatchModifierTable (std::string const &tabs, VecOpt const &tabv)
 Set modifier table for match. More...
 
ModifierTablesetMatchModifierTable (std::string const &tabs, const Uint *tabvp)
 Set modifier table for match. More...
 
ModifierTablesetMatchModifierTable (const char *tabsp, const Uint *tabvp)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More...
 
ModifierTablesetReplaceModifierTable (std::string const &tabs, VecOpt const &tabv)
 Set modifier table for replace. More...
 
ModifierTablesetReplaceModifierTable (std::string const &tabs, const Uint *tabvp)
 Set modifier table for replace. More...
 
ModifierTablesetReplaceModifierTable (const char *tabsp, const Uint *tabvp)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More...
 
ModifierTablesetCompileModifierTable (std::string const &tabs, VecOpt const &tabv)
 Set modifier table for compile. More...
 
ModifierTablesetCompileModifierTable (std::string const &tabs, const Uint *tabvp)
 Set modifier table for compile. More...
 
ModifierTablesetCompileModifierTable (const char *tabsp, const Uint *tabvp)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More...
 
ModifierTablesetMatchModifierTableToDefault ()
 Set match modifie table to default. More...
 
ModifierTablesetReplaceModifierTableToDefault ()
 Set replace modifier table to default. More...
 
ModifierTablesetCompileModifierTableToDefault ()
 Set compile modifier table to default. More...
 
ModifierTablesetAllToDefault ()
 Set all tables to default. More...
 

Detailed Description

Lets you create custom modifier tables.

An instance of this class can be passed to match, replace or compile related class objects.

Constructor & Destructor Documentation

◆ ModifierTable() [1/2]

jpcre2::ModifierTable::ModifierTable ( )
inline

Default constructor that creates an empty modifier table.

◆ ModifierTable() [2/2]

jpcre2::ModifierTable::ModifierTable ( bool  deflt)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
defltInitialize with default table if true, otherwise keep empty.

Member Function Documentation

◆ clear()

ModifierTable& jpcre2::ModifierTable::clear ( )
inline

Clear the modifier tables to their initial (empty) state.

Memory may retain for further use.

Returns
A reference to the calling ModifierTable object.

Referenced by clearCompileModifierTable(), clearMatchModifierTable(), and clearReplaceModifierTable().

+ Here is the caller graph for this function:

◆ clearCompileModifierTable()

ModifierTable& jpcre2::ModifierTable::clearCompileModifierTable ( )
inline

Clear the compile modifier table to its initial (empty) state.

Memory may retain for further use.

Returns
A reference to the calling ModifierTable object.

References clear().

+ Here is the call graph for this function:

◆ clearMatchModifierTable()

ModifierTable& jpcre2::ModifierTable::clearMatchModifierTable ( )
inline

Clear the match modifier table to its initial (empty) state.

Memory may retain for further use.

Returns
A reference to the calling ModifierTable object.

References clear().

+ Here is the call graph for this function:

◆ clearReplaceModifierTable()

ModifierTable& jpcre2::ModifierTable::clearReplaceModifierTable ( )
inline

Clear the replace modifier table to its initial (empty) state.

Memory may retain for further use.

Returns
A reference to the calling ModifierTable object.

References clear().

+ Here is the call graph for this function:

◆ fromCompileOption()

std::string jpcre2::ModifierTable::fromCompileOption ( Uint  po,
Uint  jo 
) const
inline

Take compile related option value and convert to modifier string.

Parameters
poPCRE2 option.
joJPCRE2 option.
Returns
modifier string (std::string)

Referenced by jpcre2::select< Char_T, Map >::Regex::getModifier().

+ Here is the caller graph for this function:

◆ fromMatchOption()

std::string jpcre2::ModifierTable::fromMatchOption ( Uint  po,
Uint  jo 
) const
inline

Take match related option value and convert to modifier string.

Parameters
poPCRE2 option.
joJPCRE2 option.
Returns
modifier string (std::string)

Referenced by jpcre2::select< Char_T, Map >::RegexMatch::getModifier().

+ Here is the caller graph for this function:

◆ fromReplaceOption()

std::string jpcre2::ModifierTable::fromReplaceOption ( Uint  po,
Uint  jo 
) const
inline

Take replace related option value and convert to modifier string.

Parameters
poPCRE2 option.
joJPCRE2 option.
Returns
modifier string (std::string)

Referenced by jpcre2::select< Char_T, Map >::RegexReplace::getModifier().

+ Here is the caller graph for this function:

◆ reset()

ModifierTable& jpcre2::ModifierTable::reset ( )
inline

Reset the modifier tables to their initial (empty) state including memory.

Returns
A reference to the calling ModifierTable object.

◆ resetCompileModifierTable()

ModifierTable& jpcre2::ModifierTable::resetCompileModifierTable ( )
inline

Reset the compile modifier table to its initial (empty) state including memory.

Returns
A reference to the calling ModifierTable object.

◆ resetMatchModifierTable()

ModifierTable& jpcre2::ModifierTable::resetMatchModifierTable ( )
inline

Reset the match modifier table to its initial (empty) state including memory.

Returns
A reference to the calling ModifierTable object.

◆ resetReplaceModifierTable()

ModifierTable& jpcre2::ModifierTable::resetReplaceModifierTable ( )
inline

Reset the replace modifier table to its initial (empty) state including memory.

Returns
A reference to the calling ModifierTable object.

◆ setAllToDefault()

ModifierTable& jpcre2::ModifierTable::setAllToDefault ( )
inline

Set all tables to default.

Returns
A reference to the calling ModifierTable object.

References jpcre2::ERROR::INSUFFICIENT_OVECTOR, and jpcre2::ERROR::INVALID_MODIFIER.

◆ setCompileModifierTable() [1/3]

ModifierTable& jpcre2::ModifierTable::setCompileModifierTable ( std::string const &  tabs,
VecOpt const &  tabv 
)
inline

Set modifier table for compile.

Takes a string and a vector of sequential options.

Parameters
tabsmodifier string (list of modifiers)
tabvvector of Uint (options).
Returns
A reference to the calling ModifierTable object.

◆ setCompileModifierTable() [2/3]

ModifierTable& jpcre2::ModifierTable::setCompileModifierTable ( std::string const &  tabs,
const Uint tabvp 
)
inline

Set modifier table for compile.

Takes a string and an array of sequential options.

Parameters
tabsmodifier string (list of modifiers)
tabvparray of Uint (options). If null, table is set to empty.
Returns
A reference to the calling ModifierTable object.

◆ setCompileModifierTable() [3/3]

ModifierTable& jpcre2::ModifierTable::setCompileModifierTable ( const char *  tabsp,
const Uint tabvp 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...

This one takes modifier and value by array. If the arrays are not of the same length, the behavior is undefined. If any of the argument is null, the table is set empty.

Parameters
tabspmodifier string (list of modifiers).
tabvparray of Uint (options).
Returns
A reference to the calling ModifierTable object.

◆ setCompileModifierTableToDefault()

ModifierTable& jpcre2::ModifierTable::setCompileModifierTableToDefault ( )
inline

Set compile modifier table to default.

Returns
A reference to the calling ModifierTable object.

◆ setMatchModifierTable() [1/3]

ModifierTable& jpcre2::ModifierTable::setMatchModifierTable ( std::string const &  tabs,
VecOpt const &  tabv 
)
inline

Set modifier table for match.

Takes a string and a vector of sequential options.

Parameters
tabsmodifier string (list of modifiers)
tabvvector of Uint (options).
Returns
A reference to the calling ModifierTable object.

◆ setMatchModifierTable() [2/3]

ModifierTable& jpcre2::ModifierTable::setMatchModifierTable ( std::string const &  tabs,
const Uint tabvp 
)
inline

Set modifier table for match.

Takes a string and an array of sequential options.

Parameters
tabsmodifier string (list of modifiers)
tabvparray of Uint (options). If null, table is set to empty.
Returns
A reference to the calling ModifierTable object.

◆ setMatchModifierTable() [3/3]

ModifierTable& jpcre2::ModifierTable::setMatchModifierTable ( const char *  tabsp,
const Uint tabvp 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...

This one takes modifier and value by array. If the arrays are not of the same length, the behavior is undefined. If any of the argument is null, the table is set empty.

Parameters
tabspmodifier string (list of modifiers).
tabvparray of Uint (options).
Returns
A reference to the calling ModifierTable object.

◆ setMatchModifierTableToDefault()

ModifierTable& jpcre2::ModifierTable::setMatchModifierTableToDefault ( )
inline

Set match modifie table to default.

Returns
A reference to the calling ModifierTable object.

◆ setReplaceModifierTable() [1/3]

ModifierTable& jpcre2::ModifierTable::setReplaceModifierTable ( std::string const &  tabs,
VecOpt const &  tabv 
)
inline

Set modifier table for replace.

Takes a string and a vector of sequential options.

Parameters
tabsmodifier string (list of modifiers)
tabvvector of Uint (options).
Returns
A reference to the calling ModifierTable object.

◆ setReplaceModifierTable() [2/3]

ModifierTable& jpcre2::ModifierTable::setReplaceModifierTable ( std::string const &  tabs,
const Uint tabvp 
)
inline

Set modifier table for replace.

Takes a string and an array of sequential options.

Parameters
tabsmodifier string (list of modifiers)
tabvparray of Uint (options). If null, table is set to empty.
Returns
A reference to the calling ModifierTable object.

◆ setReplaceModifierTable() [3/3]

ModifierTable& jpcre2::ModifierTable::setReplaceModifierTable ( const char *  tabsp,
const Uint tabvp 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...

This one takes modifier and value by array. If the arrays are not of the same length, the behavior is undefined. If any of the argument is null, the table is set empty.

Parameters
tabspmodifier string (list of modifiers).
tabvparray of Uint (options).
Returns
A reference to the calling ModifierTable object.

◆ setReplaceModifierTableToDefault()

ModifierTable& jpcre2::ModifierTable::setReplaceModifierTableToDefault ( )
inline

Set replace modifier table to default.

Returns
A reference to the calling ModifierTable object.

◆ toCompileOption()

void jpcre2::ModifierTable::toCompileOption ( Modifier const &  mod,
bool  x,
Uint po,
Uint jo,
int *  en,
SIZE_T eo 
) const
inline

Modifier parser for compile related options.

Parameters
modmodifier string
xwhether to add or remove the modifers.
popointer to PCRE2 compile option that will be modified.
jopointer to JPCRE2 compile option that will be modified.
enwhere to put the error number.
eowhere to put the error offset.

Referenced by jpcre2::select< Char_T, Map >::Regex::changeModifier().

+ Here is the caller graph for this function:

◆ toMatchOption()

void jpcre2::ModifierTable::toMatchOption ( Modifier const &  mod,
bool  x,
Uint po,
Uint jo,
int *  en,
SIZE_T eo 
) const
inline

Modifier parser for match related options.

Parameters
modmodifier string
xwhether to add or remove the modifers.
popointer to PCRE2 match option that will be modified.
jopointer to JPCRE2 match option that will be modified.
enwhere to put the error number.
eowhere to put the error offset.

Referenced by jpcre2::select< Char_T, Map >::RegexMatch::changeModifier().

+ Here is the caller graph for this function:

◆ toReplaceOption()

void jpcre2::ModifierTable::toReplaceOption ( Modifier const &  mod,
bool  x,
Uint po,
Uint jo,
int *  en,
SIZE_T eo 
) const
inline

Modifier parser for replace related options.

Parameters
modmodifier string
xwhether to add or remove the modifers.
popointer to PCRE2 replace option that will be modified.
jopointer to JPCRE2 replace option that will be modified.
enwhere to put the error number.
eowhere to put the error offset.

Referenced by jpcre2::select< Char_T, Map >::RegexReplace::changeModifier().

+ Here is the caller graph for this function: