VCF::Regex::Host Class Reference
Base class for performing regex searches. More...
#include <RegExKit.h>
Inheritance diagram for VCF::Regex::Host:

Public Member Functions | |
| virtual | ~Host () |
| virtual bool | hasMoreElements (const bool &backward=false) const |
| indicates whether there are any more children to enumerate through | |
| virtual Match | nextElement () |
| returns the next element in the enumeration. | |
| virtual Match | prevElement () |
| returns the previous element in the enumeration. | |
| virtual void | reset (const bool &backward=false) const |
| Resets the Enumerator's internal iterator back to the beginning (or end, if backward is true). | |
| Enumerator< Match > * | getEnumerator () |
| void | compile () |
| Parses the regex search string. | |
| Iterator | find (const unsigned char *const pos) const |
| Finds the first match result at or after the specified position. | |
| Iterator | rfind (const unsigned char *const pos) const |
| Finds the first match result at or before the specified position. | |
| Iterator | find (const ptrdiff_t pos) const |
| Finds the first match result at or after the specified position. | |
| Iterator | rfind (const ptrdiff_t pos) const |
| Finds the first match result at or before the specified position. | |
| MatchList | findAll () const |
| Finds all matches throughout the entire search range. | |
| Iterator | begin () const |
| Searches from the beginning for the first match. | |
| Iterator | end () const |
| Returns a past-the-end iterator. | |
| ReverseIterator | rbegin () const |
| Returns a ReverseIterator to the result of end(). | |
| ReverseIterator | rend () const |
| Returns a ReverseIterator to the result of begin(). | |
| const unsigned char * | changeRangeBeginning (const unsigned char *const newBeginning) |
| Moves the pointer that marks the beginning of the search range. | |
| const unsigned char * | changeRangeEnd (const unsigned char *const newEnd) |
| Moves the pointer that marks the end of the search range. | |
| String | changeSearchExpression (const String &newExpression) |
| Changes the regular expression for the search. | |
| virtual void | setRangeAsString (const String &newExpression)=0 |
| Sets the search range pointers to the beginning and end of a VCF::String object. | |
| void | clearCache () |
| Deletes information about previously found matches. | |
Protected Types | |
| typedef std::set< Match > | MatchContainerT |
| typedef MatchContainerT::iterator | InternalIterator |
| typedef MatchContainerT::const_iterator | InternalConstIterator |
Protected Member Functions | |
| Host (const String &expression, const unsigned char *first, const unsigned char *last, const RegExKit::Syntax &syntax=RegExKit::sDefault) | |
| Host (const String &expression, const RegExKit::Syntax &syntax=RegExKit::sDefault) | |
| virtual int | init ()=0 |
| Iterator | next (Iterator current) const |
| Iterator | prev (Iterator current) const |
| virtual unsigned int | characterWidth (const unsigned char *const location) const =0 |
| unsigned int | characterWidth (const ptrdiff_t &pos) const |
| virtual Match | createMatch (const OnigRegion *region, const ptrdiff_t pos) const =0 |
| virtual String::size_type | countCharacters (const unsigned char *const start, const unsigned char *const end) const =0 |
Protected Attributes | |
| MatchContainerT | cache_ |
| Match | pastTheEnd_ |
| String | expression_ |
| const unsigned char * | first_ |
| const unsigned char * | last_ |
| regex_t * | reg_ |
| OnigSyntaxType * | syntax_ |
| OnigErrorInfo | error_ |
| Iterator | enumerator_ |
Friends | |
| class | Match |
| class | Iterator |
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).
Member Typedef Documentation
|
|
|
|
|
|
|
|
|
Constructor & Destructor Documentation
|
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||
|
|
Member Function Documentation
|
|
Searches from the beginning for the first match.
|
|
|
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. Further calls to Match::getPosAsOffset() from Iterators which are still valid will give correct results.
|
|
|
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.
|
|
|
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.
|
|
|
|
|
|
Implemented in VCF::Regex::Ascii, and VCF::Regex::UTF_16LE. |
|
|
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. |
|
|
Parses the regex search string. This should always be called immediately after object creation. |
|
||||||||||||
|
Implemented in VCF::Regex::Ascii, and VCF::Regex::UTF_16LE. |
|
||||||||||||
|
Implemented in VCF::Regex::Ascii, and VCF::Regex::UTF_16LE. |
|
|
Returns a past-the-end iterator.
|
|
|
Finds the first match result at or after the specified position.
|
|
|
Finds the first match result at or after the specified position.
|
|
|
Finds all matches throughout the entire search range.
|
|
|
|
|
|
indicates whether there are any more children to enumerate through
Implements VCF::Enumerator< Match >. |
|
|
Implemented in VCF::Regex::Ascii, and VCF::Regex::UTF_16LE. |
|
|
|
|
|
returns the next element in the enumeration. Moves the internal iterator forward
Implements VCF::Enumerator< Match >. |
|
|
|
|
|
returns the previous element in the enumeration. Moves the internal iterator backward
Implements VCF::Enumerator< Match >. |
|
|
Returns a ReverseIterator to the result of end().
|
|
|
Returns a ReverseIterator to the result of begin().
|
|
|
Resets the Enumerator's internal iterator back to the beginning (or end, if backward is true).
Implements VCF::Enumerator< Match >. |
|
|
Finds the first match result at or before the specified position.
|
|
|
Finds the first match result at or before the specified position.
|
|
|
Sets the search range pointers to the beginning and end of a VCF::String object. This is implemented by classes derived from Host as the result depends on the character width and representation.
Implemented in VCF::Regex::Ascii, and VCF::Regex::UTF_16LE. |
Friends And Related Function Documentation
|
|
|
|
|
|
Member Data Documentation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The documentation for this class was generated from the following file:
- vcf/RegExKit/RegExKit.h
