Translates specific character sequences into corresponding ones; it can also use regular expression for the characters to be translated.
More...
#include <chartranslator.h>
Inheritance diagram for srchilite::CharTranslator:
Collaboration diagram for srchilite::CharTranslator:
Public Member Functions
returns a string representation: what we translate and into what we translate
Sets the nested preformatter.
More...
const std::string
preformat (const std::string &text)
Preformats the passed string (public version)
More...
Protected Member Functions
virtual const std::string
doPreformat (const std::string &text)
The actual preformatting (char translation)
More...
Protected Attributes
keeps track of the translation patterns added
the translation regular expression (for buffering)
the corresponding translated regular expression (for buffering)
the actual regular expression
whether we are at the beginning of a new line
Detailed Description
Translates specific character sequences into corresponding ones; it can also use regular expression for the characters to be translated.
This is useful for translating some characters in the input which are special characters in the output formats, e.g., & in LaTeX, or < in HTML.
Constructor & Destructor Documentation
- Parameters
-
f the decorated preformatter
Member Function Documentation
const string srchilite::CharTranslator::doPreformat
(
const std::string &
text )
protectedvirtual
The actual preformatting (char translation)
- Parameters
-
text what to translate
- Returns
- the translated string
Reimplemented from srchilite::PreFormatter.
const string srchilite::PreFormatter::preformat
(
const std::string &
text )
inherited
Preformats the passed string (public version)
- Parameters
-
text the string to be preformatted
- Returns
- the preformatted string
void srchilite::CharTranslator::set_translation
(
const std::string &
s1,
const std::string &
s2
)
Adds a translation pair.
- Parameters
-
s1 what to translate
s2 the translated expression
Sets the nested preformatter.
- Parameters
-
f the nested (decorated) preformatter
The documentation for this class was generated from the following files:
- /home/bettini/work/source-highlight/src-highlite/lib/srchilite/chartranslator.h
- /home/bettini/work/source-highlight/src-highlite/lib/srchilite/chartranslator.cc