20 #ifndef LIBMESH_OSTREAM_PROXY_H 21 #define LIBMESH_OSTREAM_PROXY_H 41 template <
typename charT=
char,
typename traits=std::
char_traits<
charT>>
49 typedef std::basic_ostream<charT,traits>
streamT;
117 (*_target) << in;
return *
this;
125 (*_target) << in;
return *
this;
131 BasicOStreamProxy & operator<< (std::basic_ios<charT,traits> & (*in)(std::basic_ios<charT,traits> &))
133 (*_target) << in;
return *
this;
141 (*_target) << in;
return *
this;
162 std::ios_base::fmtflags
flags ( )
const 168 std::ios_base::fmtflags
flags ( std::ios_base::fmtflags fmtfl )
169 {
return _target->flags(fmtfl); }
174 std::ios_base::fmtflags
setf ( std::ios_base::fmtflags fmtfl )
175 {
return _target->setf(fmtfl); }
180 std::ios_base::fmtflags
setf ( std::ios_base::fmtflags fmtfl,
181 std::ios_base::fmtflags mask )
182 {
return _target->setf(fmtfl, mask); }
187 void unsetf ( std::ios_base::fmtflags mask )
194 {
return _target->precision(); }
200 {
return _target->precision(prec); }
247 #endif // LIBMESH_OSTREAM_PROXY_H std::ios_base::fmtflags flags(std::ios_base::fmtflags fmtfl)
Set/get the associated format flags.
BasicOStreamProxy & operator<<(const T &in)
Redirect any output to the target.
std::basic_ostream< charT, traits > streamT
This class is going to be used to proxy for ostream, but other character and traits types are possibl...
std::streampos tellp()
Returns the position of the character in the current stream.
std::streamsize precision() const
Get the associated write precision.
The libMesh namespace provides an interface to certain functionality in the library.
void reset(streamT &target)
Reset the proxy to point to a different target.
This class is intended to be reseatable like a pointer-to-ostream for flexibility, but to look like a reference when used to produce less awkward user code.
streambufT * rdbuf(streambufT *sb)
Set the associated stream buffer.
std::basic_streambuf< charT, traits > streambufT
This class is going to be used to proxy for ostream, but other character and traits types are possibl...
BasicOStreamProxy OStreamProxy
void unsetf(std::ios_base::fmtflags mask)
Clear the associated flags.
streambufT * rdbuf() const
Get the associated stream buffer.
BasicOStreamProxy(streamT &target)
Default constructor.
BasicOStreamProxy & flush()
Flush the associated stream buffer.
std::ios_base::fmtflags flags() const
Get the associated format flags.
std::ios_base::fmtflags setf(std::ios_base::fmtflags fmtfl)
Set the associated flags.
streamT * _target
The pointer to the "real" ostream we send everything to.
BasicOStreamProxy(BasicOStreamProxy &old)
Shallow copy constructor.
std::streamsize precision(std::streamsize prec)
Set the associated write precision.
BasicOStreamProxy & operator=(streamT &target)
Reset the internal target to a new target output stream.
std::ios_base::fmtflags setf(std::ios_base::fmtflags fmtfl, std::ios_base::fmtflags mask)
Set the associated flags.
~BasicOStreamProxy()=default
Default destructor.