Utils - String formatting

Classes

class  StringFormatter
 Class for generating formatted strings in a similar way to the C standard library function sprintf. More...
class  StringBufferFormatter
 A StringFormatter which stores the output text in a specified buffer. More...

Functions

int vsprintf (char *str, const char *format, va_list ap)
int sprintf (char *str, const char *format,...)
int vsnprintf (char *str, size_t size, const char *format, va_list ap)
int snprintf (char *str, size_t size, const char *format,...)

Detailed Description

Extensible classes for producing formated C strings.

This also contains implementations of the C standard library functions: vsprintf, sprintf, vsnprintf and snprintf

Version:
2009-30-12
  • Correct spelling of 'Conversion' in APIs and made some tweaks to docs.

Function Documentation

int vsprintf ( char *  str,
const char *  format,
va_list  ap 
)

Generate a formatted C string.

Parameters:
str String where output is to be written.
format Format string.
ap Arguments for formatting.
Returns:
Number of bytes written to str, excluding the terminating null byte.

Definition at line 683 of file stringf.cpp.

int sprintf ( char *  str,
const char *  format,
  ... 
)

Generate a formatted C string.

Parameters:
str String where output is to be written.
format Format string.
... Arguments for formatting.
Returns:
Number of bytes written to str, excluding the terminating null byte.

Definition at line 692 of file stringf.cpp.

int vsnprintf ( char *  str,
size_t  size,
const char *  format,
va_list  ap 
)

Generate a formatted C string with a limited size.

Parameters:
str String where output is to be written.
size Size of the buffer refered to by str.
format Format string.
ap Arguments for formatting.
Returns:
Number of bytes that would have been written to str, excluding the terminating null byte if size was large enough.

Definition at line 702 of file stringf.cpp.

int snprintf ( char *  str,
size_t  size,
const char *  format,
  ... 
)

Generate a formatted C string with a limited size.

Parameters:
str String where output is to be written.
size Size of the buffer refered to by str.
format Format string.
... Arguments for formatting.
Returns:
Number of bytes that would have been written to str, excluding the terminating null byte if size was large enough.

Definition at line 713 of file stringf.cpp.


Generated by  doxygen 1.6.1