Source-highlight Library
highlightrulefactory.h
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 HIGHLIGHTRULEFACTORY_H_
8 #define HIGHLIGHTRULEFACTORY_H_
9 
10 #include <list>
11 #include <string>
12 
13 namespace srchilite {
14 
15 typedef std::list<std::string> WordList;
16 typedef std::list<std::string> ElemNameList;
17 
18 class HighlightRule;
19 
24 public:
26  virtual ~HighlightRuleFactory();
27 
34  virtual HighlightRule *createSimpleRule(const std::string &name,
35  const std::string &s) = 0;
36 
47  virtual HighlightRule *createWordListRule(const std::string &name,
48  const WordList &list, bool caseSensitve = true) = 0;
49 
58  virtual HighlightRule *createListRule(const std::string &name,
59  const WordList &list, bool caseSensitve = true) = 0;
60 
70  virtual HighlightRule *createLineRule(const std::string &name,
71  const std::string &start, const std::string &end,
72  const std::string &escape, bool nested) = 0;
73 
83  virtual HighlightRule *createMultiLineRule(const std::string &name,
84  const std::string &start, const std::string &end,
85  const std::string &escape, bool nested) = 0;
86 
95  virtual HighlightRule *createCompoundRule(const ElemNameList &nameList,
96  const std::string &rep) = 0;
97 
98 };
99 
100 }
101 
102 #endif /*HIGHLIGHTRULEFACTORY_H_*/
virtual HighlightRule * createCompoundRule(const ElemNameList &nameList, const std::string &rep)=0
Creates a rule for matching many element names, each represented by a subexpression (the number of su...
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
Abstract factory for highlighting rules.
Definition: highlightrulefactory.h:23
virtual HighlightRule * createMultiLineRule(const std::string &name, const std::string &start, const std::string &end, const std::string &escape, bool nested)=0
Creates a rule for matching a delimited string (possibly spanning more than one line) ...
Base class for highlight rules.
Definition: highlightrule.h:27
virtual HighlightRule * createWordListRule(const std::string &name, const WordList &list, bool caseSensitve=true)=0
Creates a rule for detecting a list of specific words, i.e., isolated from other parts by a space or ...
virtual HighlightRule * createListRule(const std::string &name, const WordList &list, bool caseSensitve=true)=0
Creates a rule for detecting a list of specific expressions.
virtual HighlightRule * createSimpleRule(const std::string &name, const std::string &s)=0
Creates a generic highlighting rule.
virtual HighlightRule * createLineRule(const std::string &name, const std::string &start, const std::string &end, const std::string &escape, bool nested)=0
Creates a rule for matching a delimited string (spanning a single line)