HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT::Format::Formatter< W > Class Template Reference

#include <UT_Format.h>

+ Inheritance diagram for UT::Format::Formatter< W >:

Public Types

using WriterType = W
 

Public Member Functions

 Formatter ()
 Constructs a new Formatter object. More...
 
void setReportErrors (bool flag)
 Sets whether to report format string errors or not. More...
 
void setForceDigitGroupings (bool flag)
 
size_t format (W &writer, const char *format, std::initializer_list< ArgValue > args)
 
size_t format (W &writer, const char *format, const ArgValue args[], size_t nb_args)
 
size_t printf (W &writer, const char *format, std::initializer_list< ArgValue > args)
 
size_t printf (W &writer, const char *format, const ArgValue args[], size_t nb_args)
 

Additional Inherited Members

- Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable
 UT_NonCopyable ()=default
 
 ~UT_NonCopyable ()=default
 
 UT_NonCopyable (const UT_NonCopyable &)=delete
 
UT_NonCopyableoperator= (const UT_NonCopyable &)=delete
 

Detailed Description

template<typename W = Writer>
class UT::Format::Formatter< W >

The main formatting class. This accepts a set of arguments and can subsequently format them in various ways.

Definition at line 627 of file UT_Format.h.

Member Typedef Documentation

template<typename W = Writer>
using UT::Format::Formatter< W >::WriterType = W

Definition at line 650 of file UT_Format.h.

Constructor & Destructor Documentation

template<typename W = Writer>
UT::Format::Formatter< W >::Formatter ( )
inline

Constructs a new Formatter object.

Definition at line 653 of file UT_Format.h.

Member Function Documentation

template<typename W >
size_t UT::Format::Formatter< W >::format ( W writer,
const char *  format,
std::initializer_list< ArgValue args 
)

Format the arguments into the writer, using the format string given. Returns the number of bytes written.

Parameters
writerA functor that does the writing of the formatted output. See CustomWriter for an example of how to do a custom writer.
formatThe formatting codes, as defined in Format Grammar.
argsAn initializer list that forms the list of arguments to bake into the formatted result using the format string.
Returns
The number of bytes written out to the writer functor.

Definition at line 947 of file UT_FormatImpl.h.

template<typename W >
size_t UT::Format::Formatter< W >::format ( W writer,
const char *  format,
const ArgValue  args[],
size_t  nb_args 
)

Format the arguments into the writer, using the format string given. Returns the number of bytes written.

Parameters
writerA functor that does the writing of the formatted output. See CustomWriter for an example of how to do a custom writer.
formatThe formatting codes, as defined in Format Grammar.
argsAn array of arguments to bake into the formatted result using the format string.
nb_argsThe number of items in the argument array passed in.
Returns
The number of bytes written out to the writer functor.

Definition at line 956 of file UT_FormatImpl.h.

template<typename W >
size_t UT::Format::Formatter< W >::printf ( W writer,
const char *  format,
std::initializer_list< ArgValue args 
)

Format the arguments into the writer, using the format string given. Returns the number of bytes written.

Parameters
writerA functor that does the writing of the formatted output. See CustomWriter for an example of how to do a custom writer.
formatThe formatting codes, as defined by std::printf
argsAn initializer list that forms the list of arguments to bake into the formatted result using the format string.
Returns
The number of bytes written out to the writer functor.

Definition at line 1019 of file UT_FormatImpl.h.

template<typename W >
size_t UT::Format::Formatter< W >::printf ( W writer,
const char *  format,
const ArgValue  args[],
size_t  nb_args 
)

Format the arguments into the writer, using the format string given. Returns the number of bytes written.

Parameters
writerA functor that does the writing of the formatted output. See CustomWriter for an example of how to do a custom writer.
formatThe formatting codes, as defined by std::printf
argsAn array of arguments to bake into the formatted result using the format string.
nb_argsThe number of items in the argument array passed in.
Returns
The number of bytes written out to the writer functor.

Definition at line 1027 of file UT_FormatImpl.h.

template<typename W = Writer>
void UT::Format::Formatter< W >::setForceDigitGroupings ( bool  flag)
inline

Sets whether to force numbers to print with digit grouping. Otherwise only the ',' (format), or '\'' (printf) flags dictate whether digit grouping is done.

Definition at line 664 of file UT_Format.h.

template<typename W = Writer>
void UT::Format::Formatter< W >::setReportErrors ( bool  flag)
inline

Sets whether to report format string errors or not.

Definition at line 659 of file UT_Format.h.


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