Stores possible separators implemented as regular expressions and provides functionalities to search for such occurrences in lines. More...
#include <regexranges.h>
Public Types | |
typedef std::list< boost::regex > | RegexRangesType |
Public Member Functions | |
bool | addRegexRange (const std::string &s) |
Adds a regular expression range, specified by the passed string. | |
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. | |
bool | isInRange (const std::string &line) |
void | reset () |
The next isInRange search will start from the first element of the list. | |
Private Attributes | |
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. |
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.
s | the string representation of the regular expression |
bool srchilite::RegexRanges::isInRange | ( | const std::string & | line | ) |
line | the line to inspect |
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.
line |
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.