Source-highlight Library
preformatter.h
1 //
2 // C++ Interface: preformatter
3 //
4 // Description:
5 //
6 //
7 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2005
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef PREFORMATTER_H
13 #define PREFORMATTER_H
14 
15 #include <string>
16 #include <boost/shared_ptr.hpp>
17 
18 namespace srchilite {
19 
21 
23 typedef boost::shared_ptr<PreFormatter> PreFormatterPtr;
24 
31 class PreFormatter {
33  PreFormatterPtr decorator;
34 
35 public:
39  PreFormatter(PreFormatterPtr f = PreFormatterPtr());
40 
41  virtual ~PreFormatter();
42 
47  void setPreFormatter(PreFormatterPtr f);
48 
54  const std::string preformat(const std::string &text);
55 
56 protected:
64  virtual const std::string doPreformat(const std::string &text);
65 
66 };
67 
68 }
69 
70 #endif
Preformats text to be generated.
Definition: preformatter.h:31
PreFormatter(PreFormatterPtr f=PreFormatterPtr())
Definition: preformatter.cpp:23
const std::string preformat(const std::string &text)
Preformats the passed string (public version)
Definition: preformatter.cpp:42
virtual const std::string doPreformat(const std::string &text)
Preformats the passed string (protected version).
Definition: preformatter.cpp:59
PreFormatterPtr decorator
the possible nested preformatter (Decorator pattern)
Definition: preformatter.h:33
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
void setPreFormatter(PreFormatterPtr f)
Sets the nested preformatter.
Definition: preformatter.cpp:33
boost::shared_ptr< PreFormatter > PreFormatterPtr
shared pointer for PreFormatter
Definition: preformatter.h:20