Source-highlight Library
|
Preformats text to be generated. More...
#include <preformatter.h>
Public Member Functions | |
PreFormatter (PreFormatterPtr f=PreFormatterPtr()) | |
void | setPreFormatter (PreFormatterPtr f) |
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) |
Preformats the passed string (protected version). More... | |
Private Attributes | |
PreFormatterPtr | decorator |
the possible nested preformatter (Decorator pattern) | |
Preformats text to be generated.
This implements the Decorator pattern, thus yielding a chain of preformatters
srchilite::PreFormatter::PreFormatter | ( | PreFormatterPtr | f = PreFormatterPtr() | ) |
f | the nested decorated preformatter |
|
protectedvirtual |
Preformats the passed string (protected version).
The subclasses must redefine this method to perform the preformatting. The default implementation does not perform any preformatting.
text | the string to be preformatted |
Reimplemented in srchilite::CharTranslator, and srchilite::Untabifier.
const string srchilite::PreFormatter::preformat | ( | const std::string & | text | ) |
Preformats the passed string (public version)
text | the string to be preformatted |
void srchilite::PreFormatter::setPreFormatter | ( | PreFormatterPtr | f | ) |
Sets the nested preformatter.
f | the nested (decorated) preformatter |