PhoenixFileParser  1.5.1
Set of tools to ease file parsing
Loading...
Searching...
No Matches
PHighlightParser.h
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5****************************************/
6
7#ifndef __PHIGHLIGHTPARSER_H__
8#define __PHIGHLIGHTPARSER_H__
9
10#include "PFileParser.h"
11#include "PMapTree.h"
12
20
21
33
34typedef PMapTree<char, PHighlightingAction*> PReplaceHightlightTree;
35
38 public:
40 virtual ~PHighlightParser();
41
42 void addToken(const PVecString & vecToken, const PString & replaceBeforePattern, const PString & replaceAfterPattern);
43
44 void addToken(const PString & beginPattern, const PString & endPattern, const PString & replaceBeforePattern, const PString & replaceAfterPattern);
45
46 PString makeHighlighting(const PString & content);
47
48
49 void clear();
50 private:
52 void doReplaceAction(PString & out, PFileParser & parser, PHighlightingAction* action, const PString & replacePattern, size_t indexLastMatchReplace);
56 std::vector<PHighlightingAction*> p_vecPtrAction;
57};
58
59
60
61#endif
62
PMapTree< char, PHighlightingAction * > PReplaceHightlightTree
classe qui permet de parser des fichiers texte en renvoyant les tokens les uns après les autres
Definition PFileParser.h:20
virtual ~PHighlightParser()
Destructor of PHighlightParser.
PHighlightParser()
Default constructor of PHighlightParser.
PReplaceHightlightTree p_replaceTree
Map of tree to be used to do the hightlighting.
std::vector< PHighlightingAction * > p_vecPtrAction
Vector of pointer of PHighlightingAction.
void doReplaceAction(PString &out, PFileParser &parser, PHighlightingAction *action, const PString &replacePattern, size_t indexLastMatchReplace)
Do the replace action.
void clear()
Clear all PHighlightingAction.
void initialisationPHighlightParser()
Initialisation function of the class PHighlightParser.
void addToken(const PVecString &vecToken, const PString &replaceBeforePattern, const PString &replaceAfterPattern)
Add token in the highlighter.
PString makeHighlighting(const PString &content)
Do the highlighting of the given PString.
PHighlightType
Type of the hightlighting.
Action of the hightlighting.
PString endPattern
End pattern to be used with the GET_UNITL_WITHOUT_PATTERN.
PString replaceBeforePattern
String to be placed before the replaced pattern.
PString replaceAfterPattern
String to be placed after the replaced pattern.
PHighlightType::PHighlightType type
Type of the hightlighting.