A toolkit for working with phylogenetic data.
v0.24.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 const &)=delete
 
 StringOutputTarget (StringOutputTarget &&)=delete
 
 ~StringOutputTarget () override
 
StringOutputTargetoperator= (StringOutputTarget const &)=delete
 
StringOutputTargetoperator= (StringOutputTarget &&)=delete
 
- Public Member Functions inherited from BaseOutputTarget
 BaseOutputTarget ()=default
 
 BaseOutputTarget (BaseOutputTarget const &)=default
 
 BaseOutputTarget (BaseOutputTarget &&)=default
 
virtual ~BaseOutputTarget ()
 
template<typename T >
BaseOutputTargetoperator<< (T const &content)
 Output stream operator template that simply forwards to the underlying ostream() object. More...
 
BaseOutputTargetoperator= (BaseOutputTarget const &)=default
 
BaseOutputTargetoperator= (BaseOutputTarget &&)=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. This is intended for the writer classes, which for example might want to examine the output file name. 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 const &  )
delete

◆ operator=() [2/2]

StringOutputTarget& operator= ( StringOutputTarget &&  )
delete

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