StringFormatter::ConversionSpec Class Reference

Information about a single conversion specification. More...

#include <stringf.h>

List of all members.

Public Member Functions

 ConversionSpec (va_list args)
const char * Decode (const char *format)
longlong GetIntArg (unsigned flags)
int GetIntArg ()
void * GetPointerArg ()

Public Attributes

va_list Args
 The argument list of the formatted string.
uint16_t Flags
 Bitmask of flags from Flags.
char ConversionSpecifier
 The character representing the format, e.g. 'd' if the format is "%d".
int FieldWidth
 The field width, or zero if none specified.
int Precision
 The specified precision, or -1 if none specified.

Private Member Functions

const char * ReadInt (const char *format, int &val)

Detailed Description

Information about a single conversion specification.

Definition at line 166 of file stringf.h.


Constructor & Destructor Documentation

StringFormatter::ConversionSpec::ConversionSpec ( va_list  args  ) 
Parameters:
args The argument list for the formatted string.

Definition at line 172 of file stringf.h.


Member Function Documentation

const char * StringFormatter::ConversionSpec::Decode ( const char *  format  ) 

Decode the conversion specification format, and update this class members accordingly.

Parameters:
format Pointer to conversion specification.
Returns:
Address of the character immediately after the decoded format specification in format.

Definition at line 111 of file stringf.cpp.

longlong StringFormatter::ConversionSpec::GetIntArg ( unsigned  flags  ) 

Get an integer argument, of a specified size, from the argument list.

Parameters:
flags Bitmask of values from Flags. Size of argument is detemined by one of: LengthMod_ll, LengthMod_l, LengthMod_h or LengthMod_hh; if none are present, 'int' is assumed. If SignedInt bit is set, the integer argument is sign extended.
Returns:
The argument as type long long.

Definition at line 41 of file stringf.cpp.

int StringFormatter::ConversionSpec::GetIntArg (  ) 

Get an integer argument from the argument list.

Returns:
The argument.

Definition at line 202 of file stringf.h.

void* StringFormatter::ConversionSpec::GetPointerArg (  ) 

Get an pointer argument from the argument list.

Returns:
The argument.

Definition at line 212 of file stringf.h.

const char * StringFormatter::ConversionSpec::ReadInt ( const char *  format,
int &  val 
) [private]

Read an decimal integer value from format, or if the first character is a '*', get an integer from Args.

Parameters:
format Pointer to the text to read.
[out] val The value of the integer read, or zero if format did not point to either a decimal number or a '*'.
Returns:
Address of character after the decoded decimal number (or after the '*').

Definition at line 86 of file stringf.cpp.


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

Generated by  doxygen 1.6.1