VCF::Regex::Host Class Reference
Base class for performing regex searches.
More...
#include <RegExKit.h>
Inheritance diagram for VCF::Regex::Host:
List of all members.
Detailed Description
Base class for performing regex searches.
Regex classes are derived from this to process a particular encoding method. Match results are stored within the Host object to facilitate iteration.
A Host object contains two unsigned char pointers which denote a search range beyond which the regex object will not search. Adjusting these pointers or any data within the search range after matches have been found may invalidate iterators (see changeRangeBeginning and changeRangeEnd for more details).
- See also:
- Ascii
UTF_16LE
Member Typedef Documentation
Constructor & Destructor Documentation
| virtual VCF::Regex::Host::~Host |
( |
|
) |
[virtual] |
|
| VCF::Regex::Host::Host |
( |
const String & |
expression, |
|
|
unsigned char * |
first, |
|
|
unsigned char * |
last, |
|
|
OnigSyntaxType * |
syntax = ONIG_SYNTAX_DEFAULT |
|
) |
[protected] |
|
| VCF::Regex::Host::Host |
( |
const String & |
expression, |
|
|
OnigSyntaxType * |
syntax = ONIG_SYNTAX_DEFAULT |
|
) |
[protected] |
|
Member Function Documentation
|
|
Searches from the beginning for the first match.
- Returns:
- Iterator Either the first match or a past-the-end iterator if there are no matches.
|
| unsigned char* VCF::Regex::Host::changeRangeBeginning |
( |
unsigned char * |
newBeginning |
) |
|
|
|
|
Moves the pointer that marks the beginning of the search range.
This will invalidate any iterators that point to matches lying outside the new search range. Also, any offset values (such as from Match::getPosAsOffset()) previously calculated will now be incorrect. - Parameters:
-
| unsigned | char* Pointer to the new range limit. |
- Returns:
- unsigned char* Pointer to the previous range limit.
|
| unsigned char* VCF::Regex::Host::changeRangeEnd |
( |
unsigned char * |
newEnd |
) |
|
|
|
|
Moves the pointer that marks the end of the search range.
This will invalidate any iterators that point to matches lying outside the new search range. - Parameters:
-
| unsigned | char* Pointer to the new range limit. |
- Returns:
- unsigned char* Pointer to the previous range limit.
|
| String VCF::Regex::Host::changeSearchExpression |
( |
const String & |
newExpression |
) |
|
|
|
|
Changes the regular expression for the search.
Note that this function calls clearCache(). If you want to retain previous search results, create a new Host object instead. - Parameters:
-
| String | New regular expression |
- Returns:
- String Old regular expression
|
| virtual unsigned int VCF::Regex::Host::characterWidth |
( |
const ptrdiff_t & |
pos |
) |
const [protected, pure virtual] |
|
| void VCF::Regex::Host::clearCache |
( |
|
) |
[inline] |
|
|
|
Deletes information about previously found matches.
Use this if the contents of the search range have changed since the last search or the last time the cache was cleared. Note that this invalidates all iterators for these matches. |
| void VCF::Regex::Host::compile |
( |
|
) |
|
|
|
|
Parses the regex search string.
This should always be called immediately after object creation. |
| Iterator VCF::Regex::Host::end |
( |
|
) |
[inline] |
|
|
|
Returns a past-the-end iterator.
|
| Iterator VCF::Regex::Host::find |
( |
ptrdiff_t |
pos |
) |
[inline] |
|
|
|
Finds the first match result at or after the specified position.
- Parameters:
-
| ptrdiff_t | Offset position from beginning of the search range. If this position points outside the search range, then the search will start at the beginning of the range. |
- Returns:
- Iterator An iterator pointing to the match result.
|
| Iterator VCF::Regex::Host::find |
( |
unsigned char * |
pos |
) |
|
|
|
|
Finds the first match result at or after the specified position.
- Parameters:
-
| unsigned | char* Pointer to location to start matching. If this position points outside the search range, then the search will start at the beginning of the range. |
- Returns:
- Iterator An iterator pointing to the match result.
|
|
|
Finds all matches throughout the entire search range.
- Returns:
- MatchList A std::set<Match> containing all the matches found in order of position in the search range.
|
| virtual bool VCF::Regex::Host::hasMoreElements |
( |
const bool & |
backward = false |
) |
[virtual] |
|
|
|
indicates whether there are any more children to enumerate through
- Parameters:
-
| bool | specifies whether the enumeration should be forwards or backwards. The default value is true for enumerating forwards. |
- Returns:
- bool true if there are any elements left to enumerate, otherwise returns false.
Implements VCF::Enumerator< Match >. |
| virtual int VCF::Regex::Host::init |
( |
|
) |
[protected, pure virtual] |
|
| virtual Match VCF::Regex::Host::nextElement |
( |
|
) |
[virtual] |
|
|
|
returns the next element in the enumeration.
Moves the internal iterator forward - Returns:
- COLLECTION_TYPE returns a COLLECTION_TYPE value of whatever type was specified in the template argument to the Enumerator
Implements VCF::Enumerator< Match >. |
| virtual Match VCF::Regex::Host::prevElement |
( |
|
) |
[virtual] |
|
|
|
returns the previous element in the enumeration.
Moves the internal iterator backward - Returns:
- COLLECTION_TYPE returns a COLLECTION_TYPE value of whatever type was specified in the template argument to the Enumerator
Implements VCF::Enumerator< Match >. |
|
|
Returns a ReverseIterator to the result of end().
|
|
|
Returns a ReverseIterator to the result of begin().
|
| virtual void VCF::Regex::Host::reset |
( |
const bool & |
backward = false |
) |
[virtual] |
|
|
|
Resets the Enumerator's internal iterator back to the beginning (or end, if backward is true).
- Parameters:
-
| bool | specifies which direction to reset to |
Implements VCF::Enumerator< Match >. |
| Iterator VCF::Regex::Host::rfind |
( |
ptrdiff_t |
pos |
) |
[inline] |
|
|
|
Finds the first match result at or before the specified position.
- Parameters:
-
| ptrdiff_t | Offset position from beginning of the search range. If this position points outside the search range, then the search will start at the end of the range. |
- Returns:
- Iterator An iterator pointing to the match result.
|
| Iterator VCF::Regex::Host::rfind |
( |
unsigned char * |
pos |
) |
|
|
|
|
Finds the first match result at or before the specified position.
- Parameters:
-
| unsigned | char* Pointer to location to start matching. If this position points outside the search range, then the search will start at the end of the range. |
- Returns:
- Iterator An iterator pointing to the match result.
|
Friends And Related Function Documentation
friend class Match [friend] |
|
Member Data Documentation
The documentation for this class was generated from the following file: