TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
fmt::BasicMemoryWriter< Char, Allocator > Class Template Reference

#include <format.h>

Public Member Functions

 BasicMemoryWriter (const Allocator &alloc=Allocator())
 
- Public Member Functions inherited from fmt::BasicWriter< Char >
virtual ~BasicWriter ()
 
std::size_t size () const
 
const Chardata () const FMT_NOEXCEPT
 
const Charc_str () const
 
std::basic_string< Charstr () 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
 

Private Attributes

internal::MemoryBuffer< Char,
internal::INLINE_BUFFER_SIZE,
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::BasicMemoryWriter< Char, Allocator >

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

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

+------------—+--------------------------------------------------—+ | Type | Definition | +===============+=====================================================+ | MemoryWriter | BasicMemoryWriter<char, std::allocator<char>> | +------------—+--------------------------------------------------—+ | WMemoryWriter | BasicMemoryWriter<wchar_t, std::allocator<wchar_t>> | +------------—+--------------------------------------------------—+

Example**::

MemoryWriter out; out << "The answer is " << 42 << "\n"; out.write("({:+f}, {:+f})", -3.14, 3.14);

This will write the following output to the out object:

.. code-block:: none

The answer is 42 (-3.140000, +3.140000)

The output can be converted to an std::string with out.str() or accessed as a C string with out.c_str().

Constructor & Destructor Documentation

template<typename Char , typename Allocator = std::allocator<Char>>
fmt::BasicMemoryWriter< Char, Allocator >::BasicMemoryWriter ( const Allocator &  alloc = Allocator())
inlineexplicit
2884  : BasicWriter<Char>(buffer_), buffer_(alloc) {}
internal::MemoryBuffer< Char, internal::INLINE_BUFFER_SIZE, Allocator > buffer_
Definition: format.h:2880

Member Data Documentation

template<typename Char , typename Allocator = std::allocator<Char>>
internal::MemoryBuffer<Char, internal::INLINE_BUFFER_SIZE, Allocator> fmt::BasicMemoryWriter< Char, Allocator >::buffer_
private

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