Stores possible separators implemented as regular expressions and provides functionalities to search for such occurrences in lines.
More...
#include <regexranges.h>
|
typedef std::list< boost::regex > | RegexRangesType |
|
|
bool | addRegexRange (const std::string &s) |
| Adds a regular expression range, specified by the passed string. More...
|
|
void | clear () |
| Removes all the added expressions.
|
|
const boost::regex * | matches (const std::string &line) |
| Checks whether one of the stored regular expression can be found in the passed string line. More...
|
|
bool | isInRange (const std::string &line) |
|
void | reset () |
| The next isInRange search will start from the first element of the list. More...
|
|
|
RegexRangesType | ranges |
| the actual collection of regular expressions for ranges
|
|
const boost::regex * | currentRegex |
| if set, it represents the matched regular expression up to now. More...
|
|
Stores possible separators implemented as regular expressions and provides functionalities to search for such occurrences in lines.
bool srchilite::RegexRanges::addRegexRange |
( |
const std::string & |
s | ) |
|
Adds a regular expression range, specified by the passed string.
- Parameters
-
s | the string representation of the regular expression |
- Returns
- true if the passed string is a valid regular expression, false otherwise
bool srchilite::RegexRanges::isInRange |
( |
const std::string & |
line | ) |
|
- Parameters
-
- Returns
- whether the passed line is in range
const boost::regex * srchilite::RegexRanges::matches |
( |
const std::string & |
line | ) |
|
Checks whether one of the stored regular expression can be found in the passed string line.
- Parameters
-
- Returns
- the matched regular expression or 0 if none was found
void srchilite::RegexRanges::reset |
( |
| ) |
|
|
inline |
The next isInRange search will start from the first element of the list.
This should be called before searching for lines of a file, that we started to process.
const boost::regex* srchilite::RegexRanges::currentRegex |
|
private |
if set, it represents the matched regular expression up to now.
This is used internally: if we're searching for a range, the first time we find a matching expression, we found the beginning of the range. The end of the range will be found when we match again the previously matched expression.
The documentation for this class was generated from the following files:
- /home/bettini/work/source-highlight/src-highlite/lib/srchilite/regexranges.h
- /home/bettini/work/source-highlight/src-highlite/lib/srchilite/regexranges.cpp