NGL
6.5
The NCCA Graphics Library
|
#include <format.h>
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 > | |
void | write_double (T value, const FormatSpec &spec) |
template<typename StrChar > | |
CharPtr | write_str (const StrChar *s, std::size_t size, const AlignSpec &spec) |
template<typename StrChar > | |
void | write_str (const internal::Arg::StringValue< StrChar > &str, const FormatSpec &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_ > | |
class | internal::ArgFormatterBase |
template<typename Impl , typename Char_ > | |
class | BasicPrintfArgFormatter |
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> | +------—+-------------------—+
|
private |
|
inlineexplicitprotected |
Constructs a BasicWriter
object.
|
inlinevirtual |
Destroys a BasicWriter
object.
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inline |
Returns a pointer to the output buffer content with terminating null character appended.
Definition at line 2474 of file format.h.
References fmt::Buffer< T >::reserve(), and fmt::Buffer< T >::size().
|
inline |
|
inline |
|
staticprivate |
|
private |
|
inlinestaticprivate |
|
inlineprivate |
Definition at line 2365 of file format.h.
References fmt::internal::make_ptr(), fmt::Buffer< T >::resize(), and fmt::Buffer< T >::size().
|
private |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 2597 of file format.h.
References fmt::internal::convert().
|
inline |
Definition at line 2604 of file format.h.
References fmt::BasicWriter< Char >::str().
|
inlineprivate |
Definition at line 2394 of file format.h.
References fmt::internal::operator<<().
|
private |
Definition at line 2678 of file format.h.
References fmt::ALIGN_CENTER, fmt::ALIGN_LEFT, and fmt::internal::to_unsigned().
|
inline |
Returns the total number of characters written.
Definition at line 2462 of file format.h.
References fmt::Buffer< T >::size().
|
inline |
Returns the content of the output buffer as an std::string
.
Definition at line 2486 of file format.h.
References fmt::Buffer< T >::size().
|
inline |
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
.
Definition at line 2515 of file format.h.
References FMT_VARIADIC_VOID, fmt::format(), and fmt::internal::write().
|
inlineprivate |
Definition at line 2382 of file format.h.
References fmt::internal::is_negative().
|
private |
Definition at line 2831 of file format.h.
References fmt::AlignSpec::align(), fmt::ALIGN_CENTER, fmt::ALIGN_DEFAULT, fmt::ALIGN_LEFT, fmt::ALIGN_RIGHT, fmt::WidthSpec::fill(), fmt::FormatSpec::flag(), fmt::format(), fmt::HASH_FLAG, std::numeric_limits< fmt::internal::DummyInt >::isinfinity(), std::numeric_limits< fmt::internal::DummyInt >::isnegative(), std::numeric_limits< fmt::internal::DummyInt >::isnotanumber(), fmt::PLUS_FLAG, fmt::FormatSpec::precision(), fmt::internal::report_unknown_type(), fmt::SIGN_FLAG, fmt::internal::to_unsigned(), fmt::FormatSpec::type(), and fmt::WidthSpec::width().
|
private |
Definition at line 2741 of file format.h.
References fmt::CHAR_FLAG, fmt::internal::count_digits(), fmt::internal::format_decimal(), fmt::HASH_FLAG, fmt::internal::is_negative(), fmt::PLUS_FLAG, fmt::internal::report_unknown_type(), fmt::SIGN_FLAG, fmt::BasicStringRef< Char >::size(), and fmt::internal::thousands_sep().
|
private |
Definition at line 2617 of file format.h.
References fmt::AlignSpec::align(), fmt::ALIGN_CENTER, fmt::ALIGN_RIGHT, fmt::WidthSpec::fill(), and fmt::WidthSpec::width().
|
private |
Definition at line 2640 of file format.h.
References fmt::internal::convert(), FMT_THROW, fmt::FormatSpec::precision_, fmt::internal::report_unknown_type(), fmt::internal::Value::StringValue< Char >::size, fmt::FormatSpec::type_, and fmt::internal::Value::StringValue< Char >::value.
|
inlineprivate |
Definition at line 2373 of file format.h.
References fmt::internal::count_digits(), and fmt::internal::format_decimal().
|
friend |
|
friend |
|
private |