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 BUFFEREDOUTPUT_H_
8 #define BUFFEREDOUTPUT_H_
9
10 #include <ostream>
11 #include <string>
12 #include <set>
13
15
18
31
34
37
40
46 void writePostInfo(PostContents &post,
const std::string &prefix =
"");
47
48 public:
54
60 alwaysFlush = a;
61 }
62
67 void output(
const std::string &s);
68
74
80
87 for (typename T::const_iterator it = s.begin(); it != s.end(); ++it)
89 }
90
97 for (typename T::const_iterator it = s.begin(); it != s.end(); ++it)
99 }
100
106
112
113 };
114
115 }
116
117 #endif /*BUFFEREDOUTPUT_H_*/
void setAlwaysFlush(bool a=true)
Whether to flush the output stream at each output operation.
Definition: bufferedoutput.h:59
void writePostDoc(const std::string &prefix="")
Writes all the (buffered) elements after the current document (and clear the buffer) ...
Definition: bufferedoutput.cpp:54
void postLineInsertFrom(const T &s)
Writes the elements of the passed generic collection into the contents to be output after the current...
Definition: bufferedoutput.h:86
void writePostLine(const std::string &prefix="")
Writes all the (buffered) elements after the current line (and clear the buffer)
Definition: bufferedoutput.cpp:50
std::set< std::string > PostContents
the contents to be put after a line or after the document
Definition: bufferedoutput.h:17
void postDocInsertFrom(const T &s)
Writes the elements of the passed generic collection into the contents to be output after the entire ...
Definition: bufferedoutput.h:96
void output(const std::string &s)
Writes the passed string into the output.
Definition: bufferedoutput.cpp:24
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
PostContents postLineContents
the contents to be output after each line
Definition: bufferedoutput.h:36
BufferedOutput(std::ostream &os)
Definition: bufferedoutput.cpp:17
bool alwaysFlush
whether to flush the output stream at each output operation
Definition: bufferedoutput.h:33
void postLineInsert(const std::string &s)
Writes the passed string into the contents to be output after the current line.
Definition: bufferedoutput.cpp:31
The main class for writing into the output.
Definition: bufferedoutput.h:28
void postDocInsert(const std::string &s)
Writes the passed string into the contents to be output after the entire document.
Definition: bufferedoutput.cpp:36
PostContents postDocContents
the contents to be output after the entire document
Definition: bufferedoutput.h:39
void writePostInfo(PostContents &post, const std::string &prefix="")
Writes all the (buffered) elements (and clear the buffer)
Definition: bufferedoutput.cpp:41
std::ostream & outputBuff
the stream used to output strings
Definition: bufferedoutput.h:30