HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_FormatImpl.h File Reference
+ Include dependency graph for UT_FormatImpl.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 UT
 
 UT::Format
 
 UT::Format::Detail
 

Macros

#define SIZE_CASE(TYPE, VAL)
 
#define FMT_CASE(TYPE, VAL)
 
#define SIZE_CASE(TYPE, VAL, PREC)
 
#define SIZE_CASE(TYPE, VAL, PREC)
 

Functions

UT_API size_t UT::Format::Detail::formatCodePoint (char *buffer, size_t buffer_size, utf32 cp)
 
UT_API bool UT::Format::Detail::isBufferedFile (FILE *f)
 
template<typename... Args>
size_t UTformat (FILE *file, const char *format, const Args &...args)
 
template<typename... Args>
size_t UTformat (const char *format, const Args &...args)
 
template<typename... Args>
size_t UTformat (std::ostream &os, const char *format, const Args &...args)
 
template<typename... Args>
size_t UTformat (char *buffer, size_t buffer_size, const char *format, const Args &...args)
 
template<typename... Args>
size_t UTprintf (FILE *file, const char *format, const Args &...args)
 
template<typename... Args>
size_t UTprintf (const char *format, const Args &...args)
 
template<typename... Args>
size_t UTprintf (std::ostream &os, const char *format, const Args &...args)
 
template<typename... Args>
size_t UTprintf (char *buffer, size_t buffer_size, const char *format, const Args &...args)
 

Macro Definition Documentation

#define FMT_CASE (   TYPE,
  VAL 
)
Value:
case ArgValue::Type::TYPE: \
SYSformatInteger(buf, nb_needed, arg.VAL, base, min_digits, flags); \
break;
SYS_API size_t SYSformatInteger(char *buffer, size_t buffer_size, int8 number, int base=10, int min_digits=0, SYS_FormatFlags flags=SYS_FormatFlags::None)
GLbitfield flags
Definition: glcorearb.h:1595
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
#define SIZE_CASE (   TYPE,
  VAL 
)
Value:
case ArgValue::Type::TYPE: \
nb_needed = SYSformatInteger(nullptr, 0, arg.VAL, base, min_digits, flags); \
break;
SYS_API size_t SYSformatInteger(char *buffer, size_t buffer_size, int8 number, int base=10, int min_digits=0, SYS_FormatFlags flags=SYS_FormatFlags::None)
GLbitfield flags
Definition: glcorearb.h:1595
#define SIZE_CASE (   TYPE,
  VAL,
  PREC 
)
Value:
case ArgValue::Type::TYPE: \
nb_needed = SYSformatFloat(nullptr, 0, arg.VAL, \
spec.precision == -1 ? PREC : spec.precision, notation, flags); \
break;
GLbitfield flags
Definition: glcorearb.h:1595
SYS_API size_t SYSformatFloat(char *buffer, size_t buffer_size, fpreal16 number, uint32 precision=4, SYS_FormatNotation notation=SYS_FormatNotation::Shortest, SYS_FormatFlags flags=SYS_FormatFlags::None)
#define SIZE_CASE (   TYPE,
  VAL,
  PREC 
)
Value:
case ArgValue::Type::TYPE: \
SYSformatFloat(buf, nb_needed, arg.VAL, \
spec.precision == -1 ? PREC : spec.precision, notation, flags); \
break;
GLbitfield flags
Definition: glcorearb.h:1595
SYS_API size_t SYSformatFloat(char *buffer, size_t buffer_size, fpreal16 number, uint32 precision=4, SYS_FormatNotation notation=SYS_FormatNotation::Shortest, SYS_FormatFlags flags=SYS_FormatFlags::None)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539

Function Documentation

template<typename... Args>
size_t UTformat ( FILE *  file,
const char *  format,
const Args &...  args 
)

Takes a formatting string and a set of arguments and writes out the formatted string to the FILE pointer.

Parameters
fileThe FILE pointer to write to. The FILE must be opened in write or append mode.
formatThe formatting codes, as defined in Format Grammar.
argsThe arguments to the formatting.
Returns
The number of bytes successfully written out.

Definition at line 1083 of file UT_FormatImpl.h.

template<typename... Args>
size_t UTformat ( const char *  format,
const Args &...  args 
)

Takes a formatting string and a set of arguments and writes out the formatted string to stdout.

Parameters
formatThe formatting codes, as defined in Format Grammar.
argsThe arguments to the formatting.
Returns
The number of bytes successfully written out.

Definition at line 1113 of file UT_FormatImpl.h.

template<typename... Args>
size_t UTformat ( std::ostream &  os,
const char *  format,
const Args &...  args 
)

Takes a formatting string and a set of arguments and writes out the formatted string to the output stream object.

Parameters
osThe output stream to write to.
formatThe formatting codes, as defined in Format Grammar.
argsThe arguments to the formatting.
Returns
The number of bytes successfully written out.

Definition at line 1120 of file UT_FormatImpl.h.

template<typename... Args>
size_t UTformat ( char *  buffer,
size_t  buffer_size,
const char *  format,
const Args &...  args 
)

Takes a formatting string and a set of arguments and writes out the formatted string into the buffer provided. If buffer is nullptr, then nothing is written out, but the number of bytes needed to store the entire formatted string is returned. A termination byte is not written out to the buffer. If termination is required, the caller must take care of it.

Parameters
bufferThe character buffer to write the formatted string to.
buffer_sizeThe size of the character buffer.
formatThe formatting codes, as defined in Format Grammar.
argsThe arguments to the formatting.
Returns
The number of bytes successfully written out.

Definition at line 1130 of file UT_FormatImpl.h.

template<typename... Args>
size_t UTprintf ( FILE *  file,
const char *  format,
const Args &...  args 
)

Takes a formatting string and a set of arguments and writes out the formatted string to the FILE pointer.

Parameters
fileThe FILE pointer to write to. The FILE must be opened in write or append mode.
formatThe formatting codes, as defined in Printf Grammar.
argsThe arguments to the formatting.
Returns
The number of bytes successfully written out.

Definition at line 1144 of file UT_FormatImpl.h.

template<typename... Args>
size_t UTprintf ( const char *  format,
const Args &...  args 
)

Takes a formatting string and a set of arguments and writes out the formatted string to stdout.

Parameters
formatThe formatting codes, as defined in Printf Grammar.
argsThe arguments to the formatting.
Returns
The number of bytes successfully written out.

Definition at line 1174 of file UT_FormatImpl.h.

template<typename... Args>
size_t UTprintf ( std::ostream &  os,
const char *  format,
const Args &...  args 
)

Takes a formatting string and a set of arguments and writes out the formatted string to the output stream object.

Parameters
osThe output stream to write to.
formatThe formatting codes, as defined in Printf Grammar.
argsThe arguments to the formatting.
Returns
The number of bytes successfully written out.

Definition at line 1181 of file UT_FormatImpl.h.

template<typename... Args>
size_t UTprintf ( char *  buffer,
size_t  buffer_size,
const char *  format,
const Args &...  args 
)

Takes a formatting string and a set of arguments and writes out the formatted string into the buffer provided. If buffer is nullptr, then nothing is written out, but the number of bytes needed to store the entire formatted string is returned. A termination byte is not written out to the buffer. If termination is required, the caller must take care of it.

Parameters
bufferThe character buffer to write the formatted string to.
buffer_sizeThe size of the character buffer.
formatThe formatting codes, as defined in Printf Grammar.
argsThe arguments to the formatting.
Returns
The number of bytes successfully written out.

Definition at line 1191 of file UT_FormatImpl.h.