A library for working with phylogenetic and population genetic data.
v0.32.0
StringOutputTarget Class Referencefinal

#include <genesis/utils/io/string_output_target.hpp>

Inherits BaseOutputTarget.

Detailed Description

Output target for writing data to a string.

The string that is written to is kept by reference in this class. Hence, it has to stay alive for the duration of the data writing process where this class is used. Internally, the data is buffered in a stringstream, and only written to the string on destruction of this class.

Definition at line 54 of file string_output_target.hpp.

Public Member Functions

 StringOutputTarget (std::string &target)
 Construct the output target to a string that is modified. More...
 
 StringOutputTarget (StringOutputTarget &&)=delete
 
 StringOutputTarget (StringOutputTarget const &)=delete
 
 ~StringOutputTarget () override
 
StringOutputTargetoperator= (StringOutputTarget &&)=delete
 
StringOutputTargetoperator= (StringOutputTarget const &)=delete
 
- Public Member Functions inherited from BaseOutputTarget
 BaseOutputTarget ()=default
 
 BaseOutputTarget (BaseOutputTarget &&)=default
 
 BaseOutputTarget (BaseOutputTarget const &)=default
 
virtual ~BaseOutputTarget ()
 
std::ostream & flush ()
 Flush output stream buffer. More...
 
template<typename T >
BaseOutputTargetoperator<< (T const &content)
 Output stream operator template that simply forwards to the underlying ostream() object. More...
 
BaseOutputTargetoperator= (BaseOutputTarget &&)=default
 
BaseOutputTargetoperator= (BaseOutputTarget const &)=default
 
std::ostream & ostream ()
 Get the underlying output stream that is used for writing. More...
 
std::string target_name () const
 Get a name of the output target. This is intended for user output. More...
 
std::string target_string () const
 Get a string representing the output target. More...
 

Constructor & Destructor Documentation

◆ StringOutputTarget() [1/3]

StringOutputTarget ( std::string &  target)
inlineexplicit

Construct the output target to a string that is modified.

Definition at line 65 of file string_output_target.hpp.

◆ StringOutputTarget() [2/3]

StringOutputTarget ( StringOutputTarget const &  )
delete

◆ StringOutputTarget() [3/3]

◆ ~StringOutputTarget()

~StringOutputTarget ( )
inlineoverride

Definition at line 75 of file string_output_target.hpp.

Member Function Documentation

◆ operator=() [1/2]

StringOutputTarget& operator= ( StringOutputTarget &&  )
delete

◆ operator=() [2/2]

StringOutputTarget& operator= ( StringOutputTarget const &  )
delete

The documentation for this class was generated from the following file: