![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <StrFormat.h>
Public Types | |
typedef StrLen_t(_cdecl * | STRFORMAT_t) (TYPE *pszOut, StrLen_t iLenOutMax, const TYPE *pszFormat,...) |
Public Member Functions | |
StrLen_t | ParseParam (const TYPE *pszFormat) |
StrLen_t | RenderString (TYPE *pszOut, StrLen_t nLenOutMax, const TYPE *pszParam, StrLen_t nParamLen, short nPrecision) const |
StrLen_t | RenderUInt (TYPE *pszOut, StrLen_t nLenOutMax, const TYPE *pszPrefix, RADIX_t nRadix, char chRadixA, UINT64 uVal) const |
StrLen_t | RenderFloat (TYPE *pszOut, StrLen_t nLenOutMax, char chRadixA, double dVal) const |
StrLen_t | RenderParam (TYPE *pszOut, StrLen_t nLenOutMax, va_list *pvlist) const |
Static Public Member Functions | |
static StrLen_t __stdcall | FormatV (TYPE *pszOut, StrLen_t nLenOutMax, const TYPE *pszFormat, va_list vlist) |
static StrLen_t _cdecl | FormatF (TYPE *pszOut, StrLen_t nLenOutMax, const TYPE *pszFormat,...) |
![]() | |
static char | FindSpec (char ch) noexcept |
Friends | |
class | StrFormatTests |
Additional Inherited Members | |
![]() | |
char | m_nSpec |
% type. 0 = invalid. from k_Specs. More... | |
BYTE | m_nWidthMin |
specifies minimum field width. Total width of what we place in pszOut More... | |
short | m_nPrecision |
how many chars from pszParam do we take? (not including '\0') -1 = default. More... | |
BYTE | m_nLong |
0=int, 1=long (32 bit usually), or 2=long long (64 bit usually). 'l' or 'll'. (char or wchar_t?) More... | |
bool | m_bAlignLeft |
bool | m_bPlusSign |
bool | m_bLeadZero |
StrNum::k_LEN_MAX_DIGITS_INT. More... | |
bool | m_bWidthArg |
Get an argument that will supply the m_nWidth. More... | |
bool | m_bAddPrefix |
Add a prefix 0x for hex or 0 for octal. More... | |
![]() | |
static const char | k_Specs [16] = "EFGXcdefgiopsux" |
A single formatter for a string. Like printf(). Hold a single printf type format parameter/specifier and render it.
typedef StrLen_t(_cdecl * Gray::StrFormat< TYPE >::STRFORMAT_t) (TYPE *pszOut, StrLen_t iLenOutMax, const TYPE *pszFormat,...) |
|
static |
|
static |
Replace vsnprintf,_vsnprintf_s,_vsnprintf like StrT::vsprintfN Make consistent overflow behavior for linux and _WIN32 http://opensource.apple.com//source/ruby/ruby-67.6/ruby/sprintf.c Emulate the _TRUNCATE flag in _WIN32. just stop at the overflow of nLenOutMax Do not throw exceptions from this !?
StrLen_t Gray::StrFormat< TYPE >::ParseParam | ( | const TYPE * | pszFormat | ) |
Parse the mode for 1 single argument/param from a printf() format string. e.g. d,s,u,g,f, etc. http://www.cplusplus.com/reference/cstdio/printf/
StrLen_t Gray::StrFormat< TYPE >::RenderFloat | ( | TYPE * | pszOut, |
StrLen_t | nLenOutMax, | ||
char | chRadixA, | ||
double | dVal | ||
) | const |
StrLen_t Gray::StrFormat< TYPE >::RenderParam | ( | TYPE * | pszOut, |
StrLen_t | nLenOutMax, | ||
va_list * | pvlist | ||
) | const |
Render a single parameter/spec.
StrLen_t Gray::StrFormat< TYPE >::RenderString | ( | TYPE * | pszOut, |
StrLen_t | nLenOutMax, | ||
const TYPE * | pszParam, | ||
StrLen_t | nParamLen, | ||
short | nPrecision | ||
) | const |
StrLen_t Gray::StrFormat< TYPE >::RenderUInt | ( | TYPE * | pszOut, |
StrLen_t | nLenOutMax, | ||
const TYPE * | pszPrefix, | ||
RADIX_t | nRadix, | ||
char | chRadixA, | ||
UINT64 | uVal | ||
) | const |
|
friend |