![]() |
|
PhoenixFileParser
1.5.1
Set of tools to ease file parsing
|
Parse full hightlighting of a string. More...
#include <PHighlightParser.h>
Public Member Functions | |
| void | addToken (const PString &beginPattern, const PString &endPattern, const PString &replaceBeforePattern, const PString &replaceAfterPattern) |
| Add a begin end pattern. | |
| void | addToken (const PVecString &vecToken, const PString &replaceBeforePattern, const PString &replaceAfterPattern) |
| Add token in the highlighter. | |
| void | clear () |
| Clear all PHighlightingAction. | |
| PString | makeHighlighting (const PString &content) |
| Do the highlighting of the given PString. | |
| PHighlightParser () | |
| Default constructor of PHighlightParser. | |
| virtual | ~PHighlightParser () |
| Destructor of PHighlightParser. | |
Private Member Functions | |
| void | doReplaceAction (PString &out, PFileParser &parser, PHighlightingAction *action, const PString &replacePattern, size_t indexLastMatchReplace) |
| Do the replace action. | |
| void | initialisationPHighlightParser () |
| Initialisation function of the class PHighlightParser. | |
Private Attributes | |
| PReplaceHightlightTree | p_replaceTree |
| Map of tree to be used to do the hightlighting. | |
| std::vector< PHighlightingAction * > | p_vecPtrAction |
| Vector of pointer of PHighlightingAction. | |
Parse full hightlighting of a string.
Definition at line 37 of file PHighlightParser.h.
| PHighlightParser::PHighlightParser | ( | ) |
Default constructor of PHighlightParser.
Definition at line 10 of file PHighlightParser.cpp.
References initialisationPHighlightParser().
Here is the call graph for this function:
|
virtual |
Destructor of PHighlightParser.
Definition at line 15 of file PHighlightParser.cpp.
References clear().
Here is the call graph for this function:| void PHighlightParser::addToken | ( | const PString & | beginPattern, |
| const PString & | endPattern, | ||
| const PString & | replaceBeforePattern, | ||
| const PString & | replaceAfterPattern ) |
Add a begin end pattern.
| beginPattern | : begin pattern to find |
| endPattern | : end pattern of the sequence |
| replaceBeforePattern | : PString to be placed before the begin pattern |
| replaceAfterPattern | : PString to be placed after the end pattern |
Definition at line 41 of file PHighlightParser.cpp.
References PHighlightingAction::endPattern, PHighlightType::GET_UNITL_WITHOUT_PATTERN, p_replaceTree, p_vecPtrAction, PHighlightingAction::replaceAfterPattern, PHighlightingAction::replaceBeforePattern, and PHighlightingAction::type.
| void PHighlightParser::addToken | ( | const PVecString & | vecToken, |
| const PString & | replaceBeforePattern, | ||
| const PString & | replaceAfterPattern ) |
Add token in the highlighter.
| vecToken | : vector of token to be treated with the same replace before and after |
| replaceBeforePattern | : PString to be placed before the found pattern |
| replaceAfterPattern | : PString to be placed after the found pattern |
Definition at line 24 of file PHighlightParser.cpp.
References p_replaceTree, p_vecPtrAction, PHighlightType::REPLACE, PHighlightingAction::replaceAfterPattern, PHighlightingAction::replaceBeforePattern, and PHighlightingAction::type.
| void PHighlightParser::clear | ( | ) |
Clear all PHighlightingAction.
Definition at line 116 of file PHighlightParser.cpp.
References p_vecPtrAction.
Referenced by ~PHighlightParser().
Here is the caller graph for this function:
|
private |
Do the replace action.
| [out] | out | : PString to be modified |
| parser | : PFileParser to be used to parse the current content | |
| action | : PHighlightingAction to be performed | |
| replacePattern | : current replace pattern (to put replace before and after PString around it) | |
| indexLastMatchReplace | : index of the last replace ends |
Definition at line 134 of file PHighlightParser.cpp.
References PHighlightingAction::endPattern, PHighlightType::GET_UNITL_WITHOUT_PATTERN, PFileParser::getUntilKeyWithoutPatern(), PFileParser::incrementCurrentChar(), PHighlightType::REPLACE, PHighlightingAction::replaceAfterPattern, PHighlightingAction::replaceBeforePattern, PFileParser::setCurrentCharIdx(), and PHighlightingAction::type.
Referenced by makeHighlighting().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Initialisation function of the class PHighlightParser.
Definition at line 123 of file PHighlightParser.cpp.
Referenced by PHighlightParser().
Here is the caller graph for this function:| PString PHighlightParser::makeHighlighting | ( | const PString & | content | ) |
Do the highlighting of the given PString.
| content | : PString to be used |
Definition at line 55 of file PHighlightParser.cpp.
References doReplaceAction(), PFileParser::getChar(), PFileParser::getCurrentCh(), PFileParser::getCurrentCharIdx(), PFileParser::getNbTotalChar(), PFileParser::incrementCurrentChar(), PFileParser::isEndOfFile(), p_replaceTree, PFileParser::setCurrentCharIdx(), and PFileParser::setFileContent().
Here is the call graph for this function:
|
private |
Map of tree to be used to do the hightlighting.
Definition at line 54 of file PHighlightParser.h.
Referenced by addToken(), addToken(), and makeHighlighting().
|
private |
Vector of pointer of PHighlightingAction.
Definition at line 56 of file PHighlightParser.h.
Referenced by addToken(), addToken(), and clear().