Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
fmt::BasicWriter< Char > Class Template Reference

#include <format.h>

Inheritance diagram for fmt::BasicWriter< Char >:
Inheritance graph
[legend]

Public Member Functions

Buffer< Char > & buffer () FMT_NOEXCEPT
 
const Char * c_str () const
 
void clear () FMT_NOEXCEPT
 
const Char * data () const FMT_NOEXCEPT
 
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)
 
std::size_t size () const
 
std::basic_string< Char > str () const
 
void write (BasicCStringRef< Char > format, ArgList args)
 
virtual ~BasicWriter ()
 

Protected Member Functions

 BasicWriter (Buffer< Char > &b)
 

Private Types

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

Private Member Functions

void append_float_length (Char *&format_ptr, long double)
 
template<typename T >
void append_float_length (Char *&, T)
 
 FMT_DISALLOW_COPY_AND_ASSIGN (BasicWriter)
 
CharPtr grow_buffer (std::size_t n)
 
void operator<< (typename internal::WCharHelper< wchar_t, Char >::Unsupported)
 
void operator<< (typename internal::WCharHelper< const wchar_t *, Char >::Unsupported)
 
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 Int >
void write_decimal (Int value)
 
template<typename T >
void write_double (T value, const FormatSpec &spec)
 
template<typename T , typename Spec >
void write_int (T value, Spec 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)
 
template<typename UInt >
Char * write_unsigned_decimal (UInt value, unsigned prefix_size=0)
 

Static Private Member Functions

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

Private Attributes

Buffer< Char > & buffer_
 

Friends

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

Detailed Description

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

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> | +------—+-------------------—+

Definition at line 426 of file format.h.

Member Typedef Documentation

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

Definition at line 2731 of file format.h.

Constructor & Destructor Documentation

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

Constructs a BasicWriter object.

Definition at line 2844 of file format.h.

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

Destroys a BasicWriter object.

Definition at line 2852 of file format.h.

Member Function Documentation

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

Definition at line 2827 of file format.h.

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

Definition at line 2833 of file format.h.

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

Definition at line 3030 of file format.h.

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 2875 of file format.h.

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

Definition at line 3028 of file format.h.

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 2866 of file format.h.

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 3091 of file format.h.

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

Definition at line 2740 of file format.h.

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

Definition at line 2753 of file format.h.

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

Definition at line 2924 of file format.h.

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

Definition at line 2929 of file format.h.

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

Definition at line 2933 of file format.h.

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

Definition at line 2938 of file format.h.

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

Definition at line 2942 of file format.h.

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

Formats value and writes it to the stream.

Definition at line 2953 of file format.h.

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

Definition at line 2958 of file format.h.

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

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

Definition at line 2970 of file format.h.

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

Writes a character to the stream.

Definition at line 2979 of file format.h.

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

Definition at line 2985 of file format.h.

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

Writes value to the stream.

Definition at line 2997 of file format.h.

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

Definition at line 3004 of file format.h.

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

Definition at line 3013 of file format.h.

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

Definition at line 3021 of file format.h.

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 2788 of file format.h.

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 3109 of file format.h.

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

Returns the total number of characters written.

Definition at line 2857 of file format.h.

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

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

Definition at line 2888 of file format.h.

template<typename Char>
void fmt::BasicWriter< Char >::write ( BasicCStringRef< Char >  format,
ArgList  args 
)
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 2918 of file format.h.

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

Definition at line 2772 of file format.h.

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

Definition at line 3306 of file format.h.

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

Definition at line 3186 of file format.h.

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 3035 of file format.h.

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

Definition at line 3067 of file format.h.

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

Definition at line 2762 of file format.h.

Friends And Related Function Documentation

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

Definition at line 2836 of file format.h.

template<typename Char>
friend class internal::PrintfArgFormatter< Char >
friend

Definition at line 2838 of file format.h.

Member Data Documentation

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

Definition at line 2727 of file format.h.


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


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:12:09