Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
fmt::BasicStringWriter< Char, Allocator > Class Template Reference

#include <string.h>

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

Public Member Functions

 BasicStringWriter (const Allocator &allocator=Allocator())
 
void move_to (std::basic_string< Char, std::char_traits< Char >, Allocator > &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, Allocator > buffer_
 

Additional Inherited Members

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

Detailed Description

template<typename Char, typename Allocator = std::allocator<Char>>
class fmt::BasicStringWriter< Char, Allocator >

\rst This class template provides operations for formatting and writing data into a character stream. The output is stored in a std::basic_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> | +------------—+-------------------------—+

Example**::

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 a std::basic_string with out.move_to(). \endrst

Definition at line 85 of file string.h.

Constructor & Destructor Documentation

◆ BasicStringWriter()

template<typename Char , typename Allocator = std::allocator<Char>>
fmt::BasicStringWriter< Char, Allocator >::BasicStringWriter ( const Allocator & allocator = Allocator())
inlineexplicit

\rst Constructs a :class:fmt::BasicStringWriter object. \endrst

Definition at line 95 of file string.h.

Member Function Documentation

◆ move_to()

template<typename Char , typename Allocator = std::allocator<Char>>
void fmt::BasicStringWriter< Char, Allocator >::move_to ( std::basic_string< Char, std::char_traits< Char >, Allocator > & str)
inline

\rst Moves the buffer content to str clearing the buffer. \endrst

Definition at line 103 of file string.h.

Member Data Documentation

◆ buffer_

template<typename Char , typename Allocator = std::allocator<Char>>
internal::StringBuffer<Char, Allocator> fmt::BasicStringWriter< Char, Allocator >::buffer_
private

Definition at line 87 of file string.h.


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