Source-highlight Library
srcuntabifier.h
1 //
2 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008
3 //
4 // Copyright: See COPYING file that comes with this distribution
5 //
6 
7 #ifndef SRCUNTABIFIER_H
8 #define SRCUNTABIFIER_H
9 
10 #include "preformatter.h"
11 
12 namespace srchilite {
13 
14 using std::string;
15 
19 class Untabifier : public PreFormatter {
20 public:
21 
22  Untabifier(unsigned int nSpacesPerTab, PreFormatterPtr f = PreFormatterPtr()) :
23  PreFormatter(f), nSpacesPerTab_(nSpacesPerTab), n_(0) {
24  }
25 
26  virtual const string doPreformat(const std::string &text);
27 
28 private:
29 
31  const int nSpacesPerTab_;
32 
34  unsigned int n_;
35 };
36 
37 }
38 
39 #endif // SRCUNTABIFIER_H
Preformats text to be generated.
Definition: preformatter.h:31
PreFormatter(PreFormatterPtr f=PreFormatterPtr())
Definition: preformatter.cpp:23
const int nSpacesPerTab_
the number of spaces corresponding to a tab char
Definition: srcuntabifier.h:31
PerFormratter to convert tabs to spaces before generation.
Definition: srcuntabifier.h:19
unsigned int n_
the counter of characters
Definition: srcuntabifier.h:34
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
virtual const string doPreformat(const std::string &text)
Preformats the passed string (protected version).
Definition: srcuntabifier.cpp:25
boost::shared_ptr< PreFormatter > PreFormatterPtr
shared pointer for PreFormatter
Definition: preformatter.h:20