#include <stringf.h>
Inheritance diagram for StringFormatter:

The produced text is passed to the pure virtual Out methods which are responsible for storing or outputing the string.
Supported conversion specifiers are:
Valid length modifiers are:
The default implementation correctly parses the following conversion specifiers (but produces no output)
Definition at line 76 of file stringf.h.
Public Member Functions | |
| size_t | VFormat (const char *formatString, va_list args) |
| size_t | Format (const char *formatString,...) |
| size_t | HexDumpLine (const void *data, size_t size, ptrdiff_t addressOffset=0) |
Static Public Member Functions | |
| static char * | PushHex (ulonglong val, char *dst, int precision=-1, int x='x', int prefix=false) |
| static char * | PushOctal (ulonglong val, char *dst, int precision=-1, int prefix=false) |
| static char * | PushDecimal (ulonglong val, char *dst, int precision=-1) |
Static Public Attributes | |
| static const size_t | FormatTextBufferSize = 130 |
| static const size_t | HexDumpLineSize |
Protected Types | |
| enum | Flags { FlagMinus = 1<<0, FlagPlus = 1<<1, FlagSpace = 1<<2, FlagHash = 1<<3, FlagZero = 1<<4, LengthMod_hh = 1<<8, LengthMod_h = 1<<9, LengthMod_l = 1<<10, LengthMod_ll = 1<<11, LengthMod_L = 1<<12, LengthMod_unknown = 1<<13, SignedInt = 1<<15 } |
Protected Member Functions | |
| virtual void | Out (const char *text, size_t textSize)=0 |
| virtual void | Out (char character, size_t repeatCount)=0 |
| virtual char * | UnkownFormat (char *&dstEnd, ConvertionSpec &spec) |
| char * | DefaultUnkownFormat (char *&dstEnd, ConvertionSpec &spec) |
Friends | |
| class | StringFormatter::ConvertionSpec |
Classes | |
| class | ConvertionSpec |
|
|
||||||||||||
|
Produce a formatted string.
Definition at line 403 of file stringf.cpp. |
|
||||||||||||
|
Produce a formatted string.
Definition at line 578 of file stringf.cpp. |
|
||||||||||||||||
|
Produce a single line of a hex dump. Each line represents the contents of up to 16 bytes. The format of the text is like: 12345678 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 abcdefghijklmnop
Definition at line 590 of file stringf.cpp. |
|
||||||||||||
|
Called to 'output' generated text.
Implemented in StringBufferFormatter. |
|
||||||||||||
|
Called to 'output' a repeated single character.
Implemented in StringBufferFormatter. |
|
||||||||||||
|
Called when an conversion specification is found which is not recognised. The implementation of this method should produce text corresponding to the specified format, or handle it as an error in an implementation specific manner. The default implementation of this method just calls DefaultUnkownFormat. If you wish to provide your own implementation, define the macro STRINGFORMATTER_UNKOWNFORMAT_DEFINED when compiling stringf.cpp, this will omit the implementation defined in that file.
Definition at line 395 of file stringf.cpp. |
|
||||||||||||
|
Default implemenation for UnkownFormat. This returns an empty sting and also discards any float argument from args if the conversion specifier is any of 'a', 'A', 'e', 'E', 'f', 'F', 'g' or 'G'.
Definition at line 370 of file stringf.cpp. |
|
||||||||||||||||||||||||
|
Convert an unsigned integer into a hexadecimal numeric string. The number is left padded with zeros if it contains less that precision digits, and is optionally prefixed by "0x".
Definition at line 220 of file stringf.cpp. |
|
||||||||||||||||||||
|
Convert an unsigned integer into a octal numeric string. The number is left padded with zeros if it contains less that precision digits.
Definition at line 259 of file stringf.cpp. |
|
||||||||||||||||
|
Convert an unsigned integer into a decimal numeric string. The number is left padded with zeros if it contains less that precision digits.
Definition at line 287 of file stringf.cpp. |
|
|
Size of internal buffer used for the storing the generated text for a single conversion specification. This sets a limit on the precision value for integers. |
|
|
Size of buffer required for HexDumpLine. |
1.4.4