![]() |
JPCRE2
10.32.01
C++ wrapper for PCRE2 library
|
struct to select the types. More...
#include <jpcre2.hpp>
Classes | |
struct | callback |
Provides some default static callback functions. More... | |
class | MatchEvaluator |
This class inherits RegexMatch and provides a similar functionality. More... | |
struct | MatchEvaluatorCallback |
This class contains a typedef of a function pointer or a templated function wrapper (std::function ) to provide callback function to the MatchEvaluator . More... | |
class | Regex |
Provides public constructors to create Regex object. More... | |
class | RegexMatch |
Provides public constructors to create RegexMatch objects. More... | |
class | RegexReplace |
Provides public constructors to create RegexReplace objects. More... | |
Public Types | |
typedef Char_T | Char |
Typedef for character (char , wchar_t , char16_t , char32_t ) More... | |
typedef std::basic_string< Char_T > | String |
Typedef for string (std::string , std::wstring , std::u16string , std::u32string ). More... | |
typedef class Map< String, String > | MapNas |
Map for Named substrings. More... | |
typedef class Map< String, SIZE_T > | MapNtN |
Substring name to Substring number map. More... | |
typedef MapNtN | MapNtn |
Allow spelling mistake of MapNtN as MapNtn. More... | |
typedef std::vector< String > | NumSub |
Vector for Numbered substrings (Sub container). More... | |
typedef std::vector< MapNas > | VecNas |
Vector of matches with named substrings. More... | |
typedef std::vector< MapNtN > | VecNtN |
Vector of substring name to substring number map. More... | |
typedef VecNtN | VecNtn |
Allow spelling mistake of VecNtN as VecNtn. More... | |
typedef std::vector< NumSub > | VecNum |
Vector of matches with numbered substrings. More... | |
Static Public Member Functions | |
static String | toString (Char a) |
Converts a Char_T to jpcre2::select::String. More... | |
static String | toString (Char const *a) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More... | |
static String | toString (Char *a) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More... | |
static String | toString (Pcre2Uchar *a) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ... More... | |
static String | getPcre2ErrorMessage (int err_num) |
Retruns error message from PCRE2 error number. More... | |
static String | getErrorMessage (int err_num, int err_off) |
Returns error message (either JPCRE2 or PCRE2) from error number and error offset. More... | |
struct to select the types.
Char_T | Character type (char , wchar_t , char16_t , char32_t ) |
Map | Optional parameter (Only >= C++11 ) to specify a map container (std::map , std::unordered_map etc..). Default is std::map . |
The character type (Char_T
) must be in accordance with the PCRE2 library you are linking against. If not sure which library you need, link against all 3 PCRE2 libraries and they will be used as needed.
If you want to be specific, then here's the rule:
Char_T
is 8 bit, you need 8 bit PCRE2 libraryChar_T
is 16 bit, you need 16 bit PCRE2 libraryChar_T
is 32 bit, you need 32 bit PCRE2 libraryChar_T
is not 8 or 16 or 32 bit, you will get compile error.In >= C++11
you get an additional optional template parameter to specify a map container. For example, you can use std::unordered_map
instead of the default std::map
:
We will use the following typedef throughout this doc:
typedef Char_T jpcre2::select< Char_T, Map >::Char |
Typedef for character (char
, wchar_t
, char16_t
, char32_t
)
typedef class Map< String, String > jpcre2::select< Char_T, Map >::MapNas |
Map for Named substrings.
typedef class Map< String, SIZE_T > jpcre2::select< Char_T, Map >::MapNtN |
Substring name to Substring number map.
typedef MapNtN jpcre2::select< Char_T, Map >::MapNtn |
Allow spelling mistake of MapNtN as MapNtn.
typedef std::vector<String> jpcre2::select< Char_T, Map >::NumSub |
Vector for Numbered substrings (Sub container).
typedef std::basic_string<Char_T> jpcre2::select< Char_T, Map >::String |
Typedef for string (std::string
, std::wstring
, std::u16string
, std::u32string
).
Defined as std::basic_string<Char_T>
. May be this list will make more sense:
Character | String |
---|---|
char | std::string |
wchar_t | std::wstring |
char16_t | std::u16string (>=C++11) |
char32_t | std::u32string (>=C++11) |
typedef std::vector<MapNas> jpcre2::select< Char_T, Map >::VecNas |
Vector of matches with named substrings.
typedef std::vector<MapNtN> jpcre2::select< Char_T, Map >::VecNtN |
Vector of substring name to substring number map.
typedef VecNtN jpcre2::select< Char_T, Map >::VecNtn |
Allow spelling mistake of VecNtN as VecNtn.
typedef std::vector<NumSub> jpcre2::select< Char_T, Map >::VecNum |
Vector of matches with numbered substrings.
|
inlinestatic |
Returns error message (either JPCRE2 or PCRE2) from error number and error offset.
err_num | error number (negative for PCRE2, positive for JPCRE2) |
err_off | error offset |
References jpcre2::ERROR::INVALID_MODIFIER.
Referenced by jpcre2::select< Char_T, Map >::RegexMatch::getErrorMessage(), jpcre2::select< Char_T, Map >::RegexReplace::getErrorMessage(), and jpcre2::select< Char_T, Map >::Regex::getErrorMessage().
|
inlinestatic |
Retruns error message from PCRE2 error number.
err_num | error number (negative) |
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...
Converts a Char_T* to jpcre2::select::String
a | Char_T const * |
|
inlinestatic |
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...
Converts a Char_T const * to jpcre2::select::String
a | Char_T const * |
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. ...
Converts a PCRE2_UCHAR to String
a | PCRE2_UCHAR |