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

#include <format.h>

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

Public Member Functions

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
 

Protected Member Functions

 BasicWriter (Buffer< Char > &b)
 

Private Types

typedef internal::CharTraits< Char >::CharPtr CharPtr
 

Private Member Functions

 FMT_DISALLOW_COPY_AND_ASSIGN (BasicWriter)
 
CharPtr grow_buffer (std::size_t n)
 
template<typename UInt >
Char * write_unsigned_decimal (UInt value, unsigned prefix_size=0)
 
template<typename Int >
void write_decimal (Int value)
 
CharPtr prepare_int_buffer (unsigned num_digits, const EmptySpec &, const char *prefix, unsigned prefix_size)
 
template<typename Spec >
CharPtr prepare_int_buffer (unsigned num_digits, const Spec &spec, const char *prefix, unsigned prefix_size)
 
template<typename T , typename Spec >
void write_int (T value, Spec spec)
 
template<typename T , typename Spec >
void write_double (T value, const Spec &spec)
 
template<typename StrChar >
CharPtr write_str (const StrChar *s, std::size_t size, const AlignSpec &spec)
 
template<typename StrChar , typename Spec >
void write_str (const internal::Arg::StringValue< StrChar > &str, const Spec &spec)
 
void operator<< (typename internal::WCharHelper< wchar_t, Char >::Unsupported)
 
void operator<< (typename internal::WCharHelper< const wchar_t *, Char >::Unsupported)
 
void append_float_length (Char *&format_ptr, long double)
 
template<typename T >
void append_float_length (Char *&, T)
 

Static Private Member Functions

static Char * get (Char *p)
 
static CharPtr fill_padding (CharPtr buffer, unsigned total_size, std::size_t content_size, wchar_t fill)
 

Private Attributes

Buffer< Char > & buffer_
 

Friends

template<typename Impl , typename Char_ , typename Spec_ >
class internal::ArgFormatterBase
 
template<typename Impl , typename Char_ , typename Spec_ >
class BasicPrintfArgFormatter
 

Detailed Description

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

\rst This template provides operations for formatting and writing data into a character stream. The output is stored in a buffer provided by a subclass such as :class:fmt::BasicMemoryWriter.

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

+------—+-------------------—+ | Type | Definition | +=========+======================+ | Writer | BasicWriter<char> | +------—+-------------------—+ | WWriter | BasicWriter<wchar_t> | +------—+-------------------—+

\endrst

Definition at line 2607 of file format.h.

Member Typedef Documentation

◆ CharPtr

template<typename Char >
typedef internal::CharTraits<Char>::CharPtr fmt::BasicWriter< Char >::CharPtr
private

Definition at line 2614 of file format.h.

Constructor & Destructor Documentation

◆ BasicWriter()

template<typename Char >
fmt::BasicWriter< Char >::BasicWriter ( Buffer< Char > & b)
inlineexplicitprotected

Constructs a BasicWriter object.

Definition at line 2714 of file format.h.

◆ ~BasicWriter()

template<typename Char >
virtual fmt::BasicWriter< Char >::~BasicWriter ( )
inlinevirtual

\rst Destroys a BasicWriter object. \endrst

Definition at line 2722 of file format.h.

Member Function Documentation

◆ append_float_length() [1/2]

template<typename Char >
template<typename T >
void fmt::BasicWriter< Char >::append_float_length ( Char *& ,
T  )
inlineprivate

Definition at line 2702 of file format.h.

◆ append_float_length() [2/2]

template<typename Char >
void fmt::BasicWriter< Char >::append_float_length ( Char *& format_ptr,
long double  )
inlineprivate

Definition at line 2697 of file format.h.

◆ buffer()

template<typename Char >
Buffer< Char > & fmt::BasicWriter< Char >::buffer ( )
inline

Definition at line 2877 of file format.h.

◆ c_str()

template<typename Char >
const Char * fmt::BasicWriter< Char >::c_str ( ) const
inline

Returns a pointer to the output buffer content with terminating null character appended.

Definition at line 2739 of file format.h.

◆ clear()

template<typename Char >
void fmt::BasicWriter< Char >::clear ( )
inline

Definition at line 2875 of file format.h.

+ Here is the caller graph for this function:

◆ data()

template<typename Char >
const Char * fmt::BasicWriter< Char >::data ( ) const
inline

Returns a pointer to the output buffer content. No terminating null character is appended.

Definition at line 2733 of file format.h.

+ Here is the caller graph for this function:

◆ fill_padding()

template<typename Char >
BasicWriter< Char >::CharPtr fmt::BasicWriter< Char >::fill_padding ( CharPtr buffer,
unsigned total_size,
std::size_t content_size,
wchar_t fill )
staticprivate

Definition at line 2926 of file format.h.

◆ FMT_DISALLOW_COPY_AND_ASSIGN()

template<typename Char >
fmt::BasicWriter< Char >::FMT_DISALLOW_COPY_AND_ASSIGN ( BasicWriter< Char > )
private

◆ get()

template<typename Char >
static Char * fmt::BasicWriter< Char >::get ( Char * p)
inlinestaticprivate

Definition at line 2620 of file format.h.

◆ grow_buffer()

template<typename Char >
CharPtr fmt::BasicWriter< Char >::grow_buffer ( std::size_t n)
inlineprivate

Definition at line 2630 of file format.h.

◆ operator<<() [1/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( char value)
inline

Writes a character to the stream.

Definition at line 2832 of file format.h.

◆ operator<<() [2/16]

template<typename Char >
template<typename StrChar >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( const StrFormatSpec< StrChar > & spec)
inline

Definition at line 2869 of file format.h.

◆ operator<<() [3/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( double value)
inline

Definition at line 2813 of file format.h.

◆ operator<<() [4/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( fmt::BasicStringRef< Char > value)
inline

\rst Writes value to the stream. \endrst

Definition at line 2848 of file format.h.

◆ operator<<() [5/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( int value)
inline

Definition at line 2785 of file format.h.

◆ operator<<() [6/16]

template<typename Char >
template<typename T , typename Spec , typename FillChar >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( IntFormatSpec< T, Spec, FillChar > spec)
inline

Definition at line 2862 of file format.h.

◆ operator<<() [7/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( long double value)
inline

\rst Formats value using the general format for floating-point numbers ('g') and writes it to the stream. \endrst

Definition at line 2824 of file format.h.

◆ operator<<() [8/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( long value)
inline

Definition at line 2792 of file format.h.

◆ operator<<() [9/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( LongLong value)
inline

Definition at line 2799 of file format.h.

◆ operator<<() [10/16]

template<typename Char >
void fmt::BasicWriter< Char >::operator<< ( typename internal::WCharHelper< const wchar_t *, Char >::Unsupported )
private

◆ operator<<() [11/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( typename internal::WCharHelper< StringRef, Char >::Supported value)
inline

Definition at line 2854 of file format.h.

◆ operator<<() [12/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( typename internal::WCharHelper< wchar_t, Char >::Supported value)
inline

Definition at line 2837 of file format.h.

◆ operator<<() [13/16]

template<typename Char >
void fmt::BasicWriter< Char >::operator<< ( typename internal::WCharHelper< wchar_t, Char >::Unsupported )
private

◆ operator<<() [14/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( ULongLong value)
inline

\rst Formats value and writes it to the stream. \endrst

Definition at line 2809 of file format.h.

◆ operator<<() [15/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( unsigned long value)
inline

Definition at line 2796 of file format.h.

◆ operator<<() [16/16]

template<typename Char >
BasicWriter & fmt::BasicWriter< Char >::operator<< ( unsigned value)
inline

Definition at line 2789 of file format.h.

◆ prepare_int_buffer() [1/2]

template<typename Char >
CharPtr fmt::BasicWriter< Char >::prepare_int_buffer ( unsigned num_digits,
const EmptySpec & ,
const char * prefix,
unsigned prefix_size )
inlineprivate

Definition at line 2659 of file format.h.

◆ prepare_int_buffer() [2/2]

template<typename Char >
template<typename Spec >
BasicWriter< Char >::CharPtr fmt::BasicWriter< Char >::prepare_int_buffer ( unsigned num_digits,
const Spec & spec,
const char * prefix,
unsigned prefix_size )
private

Definition at line 2943 of file format.h.

◆ size()

template<typename Char >
std::size_t fmt::BasicWriter< Char >::size ( ) const
inline

Returns the total number of characters written.

Definition at line 2727 of file format.h.

+ Here is the caller graph for this function:

◆ str()

template<typename Char >
std::basic_string< Char > fmt::BasicWriter< Char >::str ( ) const
inline

\rst Returns the content of the output buffer as an std::string. \endrst

Definition at line 2751 of file format.h.

+ Here is the caller graph for this function:

◆ write()

template<typename Char >
void fmt::BasicWriter< Char >::write ( BasicCStringRef< Char > format,
ArgList args )
inline

\rst Writes formatted data.

args* is an argument list representing arbitrary arguments.

Example**::

MemoryWriter out; out.write("Current point:\n"); out.write("({:+f}, {:+f})", -3.14, 3.14);

This will write the following output to the out object:

.. code-block:: none

Current point: (-3.140000, +3.140000)

The output can be accessed using :func:data(), :func:c_str or :func:str methods.

See also :ref:syntax. \endrst

Definition at line 2780 of file format.h.

+ Here is the caller graph for this function:

◆ write_decimal()

template<typename Char >
template<typename Int >
void fmt::BasicWriter< Char >::write_decimal ( Int value)
inlineprivate

Definition at line 2647 of file format.h.

◆ write_double()

template<typename Char >
template<typename T , typename Spec >
void fmt::BasicWriter< Char >::write_double ( T value,
const Spec & spec )
private

Definition at line 3099 of file format.h.

◆ write_int()

template<typename Char >
template<typename T , typename Spec >
void fmt::BasicWriter< Char >::write_int ( T value,
Spec spec )
private

Definition at line 3006 of file format.h.

◆ write_str() [1/2]

template<typename Char >
template<typename StrChar , typename Spec >
void fmt::BasicWriter< Char >::write_str ( const internal::Arg::StringValue< StrChar > & str,
const Spec & spec )
private

Definition at line 2905 of file format.h.

◆ write_str() [2/2]

template<typename Char >
template<typename StrChar >
BasicWriter< Char >::CharPtr fmt::BasicWriter< Char >::write_str ( const StrChar * s,
std::size_t size,
const AlignSpec & spec )
private

Definition at line 2882 of file format.h.

◆ write_unsigned_decimal()

template<typename Char >
template<typename UInt >
Char * fmt::BasicWriter< Char >::write_unsigned_decimal ( UInt value,
unsigned prefix_size = 0 )
inlineprivate

Definition at line 2638 of file format.h.

Friends And Related Symbol Documentation

◆ BasicPrintfArgFormatter

template<typename Char >
template<typename Impl , typename Char_ , typename Spec_ >
friend class BasicPrintfArgFormatter
friend

Definition at line 2708 of file format.h.

◆ internal::ArgFormatterBase

template<typename Char >
template<typename Impl , typename Char_ , typename Spec_ >
friend class internal::ArgFormatterBase
friend

Definition at line 2705 of file format.h.

Member Data Documentation

◆ buffer_

template<typename Char >
Buffer<Char>& fmt::BasicWriter< Char >::buffer_
private

Definition at line 2610 of file format.h.


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