Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::StrA Struct Reference

#include <StrA.h>

Static Public Member Functions

static bool __stdcall IsBoolTrue (const char *pszStr, bool bHead=false)
 
static bool __stdcall IsBoolFalse (const char *pszStr, bool bHead=false)
 
static const char *__stdcall GetArticleAndSpace (const char *pszWords)
 
static bool __stdcall IsPlural (const char *pszWord)
 
static INT_PTR __stdcall GetFixedIntRef (const char *&rpszExp, int nPlaces)
 
static StrLen_t __stdcall MakeNamedBitmask (char *pszOut, StrLen_t iOutSizeMax, UINT dwFlags, const char **ppszNames, ITERATE_t iMaxNames, char chSep='\0')
 
static StrLen_t __stdcall BlockReplacement (char *pszOut, StrLen_t iOutSizeMax, const char *pszInp, IIniBaseGetter *pBlockReq, bool bRecursing=false)
 

Friends

class StrATests
 

Detailed Description

Functions on 8 bit char ANSI C strings. Opposite of StrU.

Member Function Documentation

◆ BlockReplacement()

StrLen_t GRAYCALL Gray::StrA::BlockReplacement ( char *  pszOut,
StrLen_t  iOutSizeMax,
const char *  pszInp,
IIniBaseGetter pBlockReq,
bool  bRecursing = false 
)
static

Replace strings in a marked/delimited block using results from pBlockReq Used for <?X?> replacement in scripts. e.g. SPEAK "hello there <?SRC.NAME?> my name is <?NAME?>"

  • uSizeOut = only go this far in the pszOut buffer. pBlockReq = submit text found in block for block replacement. nullptr = this is just a test for blocks.
    Note
    Allowed to be recursive. ignore blocks inside quotes ? Bad properties are just blank.
    Returns
    n = new length of pszOut. may not have been changed. or k_ITERATE_BAD

◆ GetArticleAndSpace()

const char *GRAYCALL Gray::StrA::GetArticleAndSpace ( const char *  pszWords)
static

What indefinite article should be used with this word? "a ", "an ", ""

Note
This is wrong many times. i.e. some words need no article (plurals) : boots.

◆ GetFixedIntRef()

INT_PTR GRAYCALL Gray::StrA::GetFixedIntRef ( const char *&  rpszExp,
int  nPlaces 
)
static

Get a fixed point number from a string. (n nPlaces). Used for money CY ?

  • rpszExp = get the number text from here. nPlaces = how many decimal places to store.
    Returns
    the new value from the text.
    Note
    Why not use atof/strtod() ? rounding NOT ALL INTS ARE WELL STORED as FLOAT !

◆ IsBoolFalse()

bool GRAYCALL Gray::StrA::IsBoolFalse ( const char *  pszStr,
bool  bHead = false 
)
static

convert string to boolean value.

◆ IsBoolTrue()

bool GRAYCALL Gray::StrA::IsBoolTrue ( const char *  pszStr,
bool  bHead = false 
)
static

convert string to boolean value.

◆ IsPlural()

bool GRAYCALL Gray::StrA::IsPlural ( const char *  pszWord)
static

is the word already plural? but will typically appear as a single object. use with StrA::GetArticleAndSpace TODO THIS NEEDS WORK Similar to M$ System.Data.Entity.Design.PluralizationServices

◆ MakeNamedBitmask()

StrLen_t GRAYCALL Gray::StrA::MakeNamedBitmask ( char *  pszOut,
StrLen_t  iOutSizeMax,
UINT  dwFlags,
const char **  ppszNames,
ITERATE_t  iMaxNames,
char  chSep = '\0' 
)
static

For each bit set in dwFlags, copy a ppszNames[bit number] string to the pszOut. separated by |

Returns
string length

Friends And Related Function Documentation

◆ StrATests

friend class StrATests
friend

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