NGL  6.5
The NCCA Graphics Library
fmt::BasicStringWriter< Char > Class Template Reference

#include <string.h>

+ Inheritance diagram for fmt::BasicStringWriter< Char >:
+ Collaboration diagram for fmt::BasicStringWriter< Char >:

Public Member Functions

 BasicStringWriter ()
void move_to (std::basic_string< Char > &str)
- Public Member Functions inherited from fmt::BasicWriter< Char >
virtual ~BasicWriter ()
std::size_t size () const
const Char * data () const FMT_NOEXCEPT
const Char * c_str () const
std::basic_string< Char > str () const
void write (BasicCStringRef< Char > format, ArgList args)
BasicWriteroperator<< (int value)
BasicWriteroperator<< (unsigned value)
BasicWriteroperator<< (long value)
BasicWriteroperator<< (unsigned long value)
BasicWriteroperator<< (LongLong value)
BasicWriteroperator<< (ULongLong value)
BasicWriteroperator<< (double value)
BasicWriteroperator<< (long double value)
BasicWriteroperator<< (char value)
BasicWriteroperator<< (typename internal::WCharHelper< wchar_t, Char >::Supported value)
BasicWriteroperator<< (fmt::BasicStringRef< Char > value)
BasicWriteroperator<< (typename internal::WCharHelper< StringRef, Char >::Supported value)
template<typename T , typename Spec , typename FillChar >
BasicWriteroperator<< (IntFormatSpec< T, Spec, FillChar > spec)
template<typename StrChar >
BasicWriteroperator<< (const StrFormatSpec< StrChar > &spec)
void clear () FMT_NOEXCEPT
Buffer< Char > & buffer () FMT_NOEXCEPT

Private Attributes

internal::StringBuffer< Char > buffer_

Additional Inherited Members

- Protected Member Functions inherited from fmt::BasicWriter< Char >
 BasicWriter (Buffer< Char > &b)

Detailed Description

template<typename Char>
class fmt::BasicStringWriter< Char >

This class template provides operations for formatting and writing data into a character stream. The output is stored in std::string that grows dynamically.

You can use one of the following typedefs for common character types and the standard allocator:

+------------—+-------------------------—+ | Type | Definition | +===============+============================+ | StringWriter | BasicStringWriter<char> | +------------—+-------------------------—+ | WStringWriter | BasicStringWriter<wchar_t> | +------------—+-------------------------—+


StringWriter out; out << "The answer is " << 42 << "\n";

This will write the following output to the out object:

.. code-block:: none

The answer is 42

The output can be moved to an std::string with out.move_to().

Definition at line 75 of file string.h.

Constructor & Destructor Documentation

template<typename Char >
fmt::BasicStringWriter< Char >::BasicStringWriter ( )

Constructs a :class:fmt::BasicStringWriter object.

Definition at line 85 of file string.h.

Member Function Documentation

template<typename Char >
void fmt::BasicStringWriter< Char >::move_to ( std::basic_string< Char > &  str)

Moves the buffer content to str clearing the buffer.

Definition at line 92 of file string.h.

References fmt::internal::StringBuffer< Char >::move_to().

+ Here is the call graph for this function:

Member Data Documentation

template<typename Char >
internal::StringBuffer<Char> fmt::BasicStringWriter< Char >::buffer_

Definition at line 77 of file string.h.

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