The main class for writing into the output.
More...
#include <bufferedoutput.h>
Collaboration diagram for srchilite::BufferedOutput:
Public Member Functions
Whether to flush the output stream at each output operation.
More...
void
output (const std::string &s)
Writes the passed string into the output.
More...
Writes the passed string into the contents to be output after the current line.
More...
Writes the passed string into the contents to be output after the entire document.
More...
template<typename T >
Writes the elements of the passed generic collection into the contents to be output after the current line.
More...
template<typename T >
Writes the elements of the passed generic collection into the contents to be output after the entire document.
More...
Writes all the (buffered) elements after the current line (and clear the buffer)
More...
Writes all the (buffered) elements after the current document (and clear the buffer)
More...
Private Member Functions
Writes all the (buffered) elements (and clear the buffer)
More...
Private Attributes
the stream used to output strings
whether to flush the output stream at each output operation
the contents to be output after each line
the contents to be output after the entire document
Detailed Description
The main class for writing into the output.
It wraps an ostream object and can perform buffering. Moreover, it provides functionalities to write something after a line or after an entire document (these contents are buffered so that they can be inserted at any time, with postLineInsert and postDocInsert and will be actually inserted in the output with writePostLine and writePostDoc).
Constructor & Destructor Documentation
srchilite::BufferedOutput::BufferedOutput
(
std::ostream &
os )
- Parameters
-
os the ostream where data will be written
Member Function Documentation
void srchilite::BufferedOutput::output
(
const std::string &
s )
Writes the passed string into the output.
- Parameters
-
s
void srchilite::BufferedOutput::postDocInsert
(
const std::string &
s )
Writes the passed string into the contents to be output after the entire document.
- Parameters
-
s
template<typename T >
void srchilite::BufferedOutput::postDocInsertFrom
(
const T &
s )
inline
Writes the elements of the passed generic collection into the contents to be output after the entire document.
- Parameters
-
s
void srchilite::BufferedOutput::postLineInsert
(
const std::string &
s )
Writes the passed string into the contents to be output after the current line.
- Parameters
-
s
template<typename T >
void srchilite::BufferedOutput::postLineInsertFrom
(
const T &
s )
inline
Writes the elements of the passed generic collection into the contents to be output after the current line.
- Parameters
-
s
void srchilite::BufferedOutput::setAlwaysFlush
(
bool
a = true )
inline
Whether to flush the output stream at each output operation.
- Parameters
-
a
void srchilite::BufferedOutput::writePostDoc
(
const std::string &
prefix = "" )
Writes all the (buffered) elements after the current document (and clear the buffer)
- Parameters
-
prefix the string to prefix all the elements
void srchilite::BufferedOutput::writePostInfo
(
PostContents &
post,
const std::string &
prefix = ""
)
private
Writes all the (buffered) elements (and clear the buffer)
- Parameters
-
post the buffered elements
prefix the string to prefix all the elements
void srchilite::BufferedOutput::writePostLine
(
const std::string &
prefix = "" )
Writes all the (buffered) elements after the current line (and clear the buffer)
- Parameters
-
prefix the string to prefix all the elements
The documentation for this class was generated from the following files:
- /home/bettini/work/source-highlight/src-highlite/lib/srchilite/bufferedoutput.h
- /home/bettini/work/source-highlight/src-highlite/lib/srchilite/bufferedoutput.cpp