|
ldas-tools-al 2.6.7
|
Regular Expression Match. More...
#include <regexmatch.hh>
Public Types | |
| typedef size_t | off_type |
| typedef int | flag_type |
| typedef size_t | off_type |
| typedef int | flag_type |
Public Member Functions | |
| RegexMatch (off_type nmatches=0) | |
| Constructor. | |
| ~RegexMatch () | |
| Destructor. | |
| bool | match (const Regex &r, const char *string, flag_type eflags=0) |
| Perform a Regex Match. | |
| off_type | capacity () const |
| off_type | size () const |
| bool | isSubValid (off_type m) |
| Check Substring Match Validity. | |
| const char * | getSubStart (off_type m) |
| Get Substring Start. | |
| const char * | getSubEnd (off_type m) |
| Get Substring End. | |
| int | getSubStartOffset (off_type m) |
| Get Substring Starting Offset. | |
| int | getSubEndOffset (off_type m) |
| Get Substring Ending Offset. | |
| off_type | getSubLength (off_type m) |
| Get Substring Length. | |
| std::string | getSubString (off_type m) |
| Get Substring. | |
| off_type | getNMatches () const |
| Get Number of Matches. | |
| RegexMatch (off_type nmatches=0) | |
| ~RegexMatch () | |
| bool | match (const Regex &r, const char *string, flag_type eflags=0) |
| off_type | capacity () const |
| off_type | size () const |
| bool | isSubValid (off_type m) |
| const char * | getSubStart (off_type m) |
| const char * | getSubEnd (off_type m) |
| int | getSubStartOffset (off_type m) |
| int | getSubEndOffset (off_type m) |
| off_type | getSubLength (off_type m) |
| std::string | getSubString (off_type m) |
| off_type | getNMatches () const |
Private Attributes | |
| regmatch_t * | mMatches |
| off_type | mNMatches |
| const char * | mString |
| off_type | found |
Regular Expression Match.
This class represents a regular expression match. It attempts to match a string with a regular expression, storing the information resulting from captures (the parenthesis expressions).
| typedef int RegexMatch::flag_type |
| typedef int RegexMatch::flag_type |
| typedef size_t RegexMatch::off_type |
| typedef size_t RegexMatch::off_type |
| RegexMatch::RegexMatch | ( | off_type | nmatches = 0 | ) |
Constructor.
| nmatches |
| RegexMatch::~RegexMatch | ( | ) |
Destructor.
| RegexMatch::RegexMatch | ( | off_type | nmatches = 0 | ) |
| RegexMatch::~RegexMatch | ( | ) |
|
inline |
Returns the maximum number of matches which this object can hold. This is equal to the number of matches which was passed to the constructor.
| off_type RegexMatch::capacity | ( | ) | const |
|
inline |
Get Number of Matches.
Returns the maximum number of matches which this object can hold. This is equal to the number of matches which was passed to the constructor.
| off_type RegexMatch::getNMatches | ( | ) | const |
|
inline |
Get Substring End.
Returns a pointer to the end of a substring match. If the requested match is not valid, a null pointer is returned.
| m |
| const char * RegexMatch::getSubEnd | ( | off_type | m | ) |
Get Substring Ending Offset.
Returns the offset to the end of a substring match. If the requested match is not valid, then -1 is returned.
| m |
|
inline |
Get Substring Length.
Returns the number of characters in a substring match.
| m |
|
inline |
Get Substring Start.
Returns a pointer to the beginning of a substring match. If the requested match is not valid, a null pointer is returned.
| m |
| const char * RegexMatch::getSubStart | ( | off_type | m | ) |
Get Substring Starting Offset.
Returns the offset to the beginning of a substring match. If the requested match is not valid, then -1 is returned.
| m |
| std::string RegexMatch::getSubString | ( | off_type | m | ) |
Get Substring.
Return a substring as a C++ string object.
| m | Index of match starting from zero. |
| std::string RegexMatch::getSubString | ( | off_type | m | ) |
|
inline |
Check Substring Match Validity.
This returns whether or not a substring match exists at the specified index.
| m |
| bool RegexMatch::isSubValid | ( | off_type | m | ) |
Perform a Regex Match.
| r | Precompiled pattern buffer |
| string | Text string containing the input text |
| eflags | flag which cause changes in matching behavior
|
|
inline |
| off_type RegexMatch::size | ( | ) | const |
|
private |
|
private |
|
private |
|
private |