JPCRE2  10.31.02
C++ wrapper for PCRE2 library
jpcre2::select< Char_T, Map >::callback Struct Reference

Provides some default static callback functions. More...

#include <jpcre2.hpp>

Static Public Member Functions

static String eraseFill (NumSub const &num, MapNas const &nas, MapNtN const &ntn)
 Callback function that removes the matched part/s in the subject string and takes all match vectors as argument. More...
 
static String erase (void *, void *, void *)
 Callback function that removes the matched part/s in the subject string and does not take any match vector. More...
 
static String fill (NumSub const &num, MapNas const &nas, MapNtn const &ntn)
 Callback function for populating match vectors that does not modify the subject string. More...
 

Detailed Description

template<typename Char_T, template< typename... > class Map = std::map>
struct jpcre2::select< Char_T, Map >::callback

Provides some default static callback functions.

The primary goal of this class is to provide default callback function to MatchEvaluator default constructor which is essentially callback::erase. This class does not allow object instantiation.

Member Function Documentation

◆ erase()

template<typename Char_T, template< typename... > class Map = std::map>
static String jpcre2::select< Char_T, Map >::callback::erase ( void *  ,
void *  ,
void *   
)
inlinestatic

Callback function that removes the matched part/s in the subject string and does not take any match vector.

This is a minimum cost pattern deleting callback function.

It's the default callback function when you Instantiate a MatchEvaluator object with its default constructor:

MatchEvaluator me;
Returns
empty string.

◆ eraseFill()

template<typename Char_T, template< typename... > class Map = std::map>
static String jpcre2::select< Char_T, Map >::callback::eraseFill ( NumSub const &  num,
MapNas const &  nas,
MapNtN const &  ntn 
)
inlinestatic

Callback function that removes the matched part/s in the subject string and takes all match vectors as argument.

Even though this function itself does not use the vectors, it still takes them so that the caller can perform a match and populate all the match data to perform further evaluation of other callback functions without doing the match again.

Parameters
numjp::NumSub vector.
nasjp::MapNas map.
ntnjp::MapNtN map.
Returns
empty string.

◆ fill()

template<typename Char_T, template< typename... > class Map = std::map>
static String jpcre2::select< Char_T, Map >::callback::fill ( NumSub const &  num,
MapNas const &  nas,
MapNtn const &  ntn 
)
inlinestatic

Callback function for populating match vectors that does not modify the subject string.

It always returns the total matched part and thus the subject string remains the same.

Parameters
numjp::NumSub vector.
nasjp::MapNas map.
ntnjp::MapNtN map.
Returns
total match (group 0) of current match.