DIY 3.0 data-parallel out-of-core C++ library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Typedefs Groups Pages
Public Member Functions | List of all members
fmt::BasicMemoryWriter< Char, Allocator > Class Template Reference

`#include <diy/fmt/format.h>`

Inheritance diagram for fmt::BasicMemoryWriter< Char, Allocator >:

## Public Member Functions
| BasicMemoryWriter (const Allocator &alloc=Allocator())
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)
BasicWriter & | operator<< (int value)
BasicWriter & | operator<< (unsigned value)
BasicWriter & | operator<< (long value)
BasicWriter & | operator<< (unsigned long value)
BasicWriter & | operator<< (LongLong value)
BasicWriter & | operator<< (ULongLong value)
BasicWriter & | operator<< (double value)
BasicWriter & | operator<< (long double value)
BasicWriter & | operator<< (char value)
BasicWriter & | operator<< (typename internal::WCharHelper< wchar_t, Char >::Supported value)
BasicWriter & | operator<< (fmt::BasicStringRef< Char > value)
BasicWriter & | operator<< (typename internal::WCharHelper< StringRef, Char >::Supported value)
template<typename T , typename Spec , typename FillChar >
BasicWriter & | operator<< (IntFormatSpec< T, Spec, FillChar > spec)
template<typename StrChar >
BasicWriter & | operator<< (const StrFormatSpec< StrChar > &spec)
void | clear () FMT_NOEXCEPT
Buffer< Char > & | buffer () FMT_NOEXCEPT
template<typename StrChar >
BasicWriter< Char >::CharPtr | write_str (const StrChar *s, std::size_t size, const AlignSpec &spec)
template<typename Spec >
BasicWriter< Char >::CharPtr | prepare_int_buffer (unsigned num_digits, const Spec &spec, const char *prefix, unsigned prefix_size)

## 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()`.

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

- include/diy/fmt/format.h