1 //
2 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008
3 //
4 // Copyright: See COPYING file that comes with this distribution
5 //
6
7 #ifndef HIGHLIGHTTOKEN_H_
8 #define HIGHLIGHTTOKEN_H_
9
10 #include <string>
11 #include <list>
12 #include <vector>
13 #include <algorithm>
14
16
18
23 typedef std::list<std::pair<std::string, std::string> >
MatchedElements;
24
29
36
39
42
45
49
54
57
59 HighlightToken(
const std::string &elem,
const std::string &matched,
62
74 }
75
80
86 void addMatched(
const std::string &elem,
const std::string &s);
87 };
88
89 }
90
91 #endif /*HIGHLIGHTTOKEN_H_*/
std::vector< std::string > MatchedSubExps
The matched subexpressions (if the original rule had subexpressions)
Definition: highlighttoken.h:28
bool prefixOnlySpaces
true if the prefix is empty or contains only spaces
Definition: highlighttoken.h:38
MatchedElements matched
the matched elements information
Definition: highlighttoken.h:44
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
const HighlightRule * rule
the matching rule
Definition: highlighttoken.h:56
std::string prefix
the possible prefix (part before the matched string)
Definition: highlighttoken.h:35
unsigned int matchedSize
the size of the whole matched sequence (this is computed automatically when matched elements are set ...
Definition: highlighttoken.h:48
void addMatched(const std::string &elem, const std::string &s)
Adds information about a matched element.
Definition: highlighttoken.cpp:32
Base class for highlight rules.
Definition: highlightrule.h:27
void clearMatched()
Resets the matched related fields (i.e., matched, matchedSize)
Definition: highlighttoken.cpp:37
Token containing information for performing the highlight.
Definition: highlighttoken.h:33
MatchedSubExps matchedSubExps
The matched subexpressions (in case the rule had subexpressions)
Definition: highlighttoken.h:53
std::string suffix
the possible suffix (part after the matched string)
Definition: highlighttoken.h:41
std::list< std::pair< std::string, std::string > > MatchedElements
The matched element information by a rule.
Definition: highlighttoken.h:17
void copyFrom(const HighlightToken &token)
Copy from the passed toke.
Definition: highlighttoken.h:67