SyDEVS
v0.6.7
Multiscale Simulation and Systems Modeling Library
|
A class for converting stream objects to string values. More...
#include <string_builder.h>
Public Member Functions | |
string_builder () | |
Constructs a string_builder object. More... | |
string_builder (const string_builder &)=delete | |
No copy constructor. More... | |
string_builder & | operator= (const string_builder &)=delete |
No copy assignment. More... | |
string_builder (string_builder &&)=delete | |
No move constructor. More... | |
string_builder & | operator= (string_builder &&)=delete |
No move assignment. More... | |
~string_builder ()=default | |
Destructor. More... | |
std::string | str () const |
Obtains the data stored in the string_builder object as a std::string . More... | |
template<class T > | |
string_builder & | operator<< (T const &value) |
Inserts data into the stream. More... | |
A class for converting stream objects to string values.
Several sydevs classes overload the operator<<
to append a textual representation of the class instance to a std::ostream
object. The string_builder
class provides a convenient way to convert these std::ostream
objects into std::string
values without requiring additional lines of code. Primitives and other classes can also be converted to strings.
|
inline |
Constructs a string_builder
object.
|
delete |
No copy constructor.
|
delete |
No move constructor.
|
default |
Destructor.
|
inline |
Inserts data into the stream.
If an operation such as operator<<(std::ostream&, const T&)
is defined for type T
, then a copy of the information in value
is inserted into the string_builder
object for later retrieval via str()
.
value | The value to be inserted. |
string_builder
object, allowing multiple values to be inserted in a single line.
|
delete |
No copy assignment.
|
delete |
No move assignment.
|
inline |
Obtains the data stored in the string_builder
object as a std::string
.