22#include <boost/iostreams/stream.hpp>
23#include <boost/iostreams/stream_buffer.hpp>
24#include <boost/iostreams/device/back_inserter.hpp>
46 private boost::noncopyable
76 const std::ostream&
os()
const;
93 const std::string&
str()
const;
Similar to ostringstream but allows fast read-only access directly into the std::string being written...
std::string m_own_target_str
Underlying string to use if user chooses not to pass in their own in constructor.
void str_clear()
Performs std::string::clear() on the object returned by str().
String_ostream(std::string *target_str=0)
Wraps either the given std::string or a newly created empty string if a null pointer is passed.
boost::iostreams::stream< boost::iostreams::back_insert_device< std::string > > String_appender_ostream
Short-hand for an ostream writing to which will append to an std::string it is adapting.
std::ostream & os()
Access to stream that will write to owned string.
const std::string & str() const
Read-only access to the string being wrapped.
boost::iostreams::back_insert_device< std::string > m_target_inserter
Inserter into m_target.
String_appender_ostream m_target_appender_ostream
Appender ostream into m_target by way of m_target_inserter. Write/flush here to write to m_target.
std::string * m_target
Pointer to the target string. Emptied at construction and in str_clear() only.
Flow module containing miscellaneous general-use facilities that don't fit into any other Flow module...