CTL String Processing


Files

file  cstring.c
 Implementations of ctl_sconst specific code and units.
file  cstring.h
 Safe constant, fixed-length and variable length string templates.
file  cstring.temp.h
 Safe constant, fixed-length string template functions.
file  ctlstring.c
 A place to manufacture string templates and related functions/data.
file  ctlstring.h
 Safe constant, fixed-length and variable length string templates.
file  fstring.h
 Fixed string class.
file  gstring.h
 Growing string class.
file  mstring.c
 Implementations of ctl_mstring specific code and units.
file  mstring.h
 Mutable string class generator.
file  mstring.temp.h
 Mutable string class generator template implementation.

Defines

#define ctl_sconst(tchar)   ppConcat(ctl_sconst_,tchar)
 Get class name from base name and character type.
#define ctl_sconst_(tchar, function)   ppConcat3(ctl_sconst( tchar ),_,function)
 Build the function name from character type and root class.
#define ctl_sconst_auto(tchar, begin, end, label)   ctl_sconst( tchar ) label = { (begin), (begin), (end) }
 Make fixed string operator on stack or as a global, with begin/end pointers Uses non-standard ANSI extension: non-const initializers.
#define ctl_sconst_auto_string(tchar, mstr, label)   ctl_sconst( tchar ) label = { (mstr)->begin, (mstr)->begin, (mstr)->end }
 Make fixed string operator on stack or as a global, with buffer Uses non-standard ANSI extension: non-const initializers.
#define ctl_sconst_auto_buff(tchar, buff, len, label)   ctl_sconst( tchar ) label = { (buff), (buff), (buff)+cstrnlen(tchar)((buff),(len)) }
 Make fixed string operator on stack or as a global, with buffer Uses non-standard ANSI extension: non-const initializers.
#define ctl_sconst_auto_sz(tchar, sz, label)   ctl_sconst( tchar ) label = { (sz), (sz), (sz)+cstrlen(tchar)((sz)) }
 Make fixed string operator on stack or as a global, with buffer Uses non-standard ANSI extension: non-const initializers.
#define ctl_sconst_auto_mmap(tchar, mmap, label)   ctl_sconst( tchar ) label = { (const tchar*)ctl_mmap_ptr(mmap), (const tchar*)ctl_mmap_ptr(mmap), (const tchar*)ctl_mmap_ptr(mmap)+ctl_mmap_size(mmap) }
 Make fixed string operator on stack or as a global, with buffer Uses non-standard ANSI extension: non-const initializers.
#define ctl_sconst_init(tchar, self, buff, len)
 Initialize from a pointer and length.
#define ctl_sconst_init_sz(tchar, self, sz)
 Initialize from a NUL terminated string pointer.
#define ctl_sconst_init_mmap(tchar, self, mmap)
 Initialize from a NUL terminated string pointer.
#define ctl_sconst_printf_fmt(tchar)   szconst(tchar,"%.*s")
 Printf format string for ctl_sconst_printf_arg.
#define ctl_sconst_printf_arg(self)   ((self)->end - (self)->begin), (self)->begin
 Printf arguments for ctl_sconst_printf_fmt.
#define ctl_sconst_copy(tchar, self, from)
 Copy from another ctlmfg_ctl_sconst.
#define ctl_sconst_init_pointers(tchar, self, pBegin, pEnd)
 Initialize from a pointer and length.
#define ctl_sconst_from_ctlfixed(tchar, self, fixed)
 Reference a fixed C string for parsing.
#define ctl_sconst_from_ctlstring(tchar, self, variable)
 Reference a fixed C string for parsing.
#define ctl_sconst_remain(tchar, self)   ( (self)->end - (self)->parse )
 Tell how many characters remain to be parsed.
#define ctl_sconst_consumed(tchar, self)   ( (self)->parse - (self)->begin )
 Tell how many characters have been parsed.
#define ctl_sconst_size(tchar, self)   ((size_t)( (self)->end - (self)->begin ))
 Tell how many characters are in the string.
#define ctl_sconst_parse(tchar, self)   ( (self)->parse )
 Get current parse position.
#define ctl_sconst_reset(tchar, self)   ( (self)->parse = (self)->begin )
 Reset parse point to beginning.
#define ctl_sconst_begin(tchar, self)   ( (self)->begin )
 Reset parse point to beginning.
#define ctl_sconst_end(tchar, self)   ( (self)->end )
 Reset parse point to beginning.
#define ctl_sconst_next(tchar, self)   ( (self)->parse < (self)->end ? (++(self)->parse) : (self)->end )
 Parse to next character in const string.
#define ctl_sconst_prev(tchar, self)   ( (self)->parse > (self)->begin ? (--(self)->parse) : (self)->begin )
 Parse to previous character in const string.
#define ctl_sconst_isalnum(tchar, self)   ( cisalnum(tchar)(*(self)->parse) )
 C runtime clone of isalnum.
#define ctl_sconst_isalpha(tchar, self)   ( cisalpha(tchar)(*(self)->parse) )
 C runtime clone of isalpha.
#define ctl_sconst_iscntrl(tchar, self)   ( ciscntrl(tchar)(*(self)->parse) )
 C runtime clone of iscntrl.
#define ctl_sconst_isdigit(tchar, self)   ( cisdigit(tchar)(*(self)->parse) )
 C runtime clone of isdigit.
#define ctl_sconst_isgraph(tchar, self)   ( cisgraph(tchar)(*(self)->parse) )
 C runtime clone of isgraph.
#define ctl_sconst_islower(tchar, self)   ( cislower(tchar)(*(self)->parse) )
 C runtime clone of islower.
#define ctl_sconst_ispunct(tchar, self)   ( cispunct(tchar)(*(self)->parse) )
 C runtime clone of ispunct.
#define ctl_sconst_isspace(tchar, self)   ( cisspace(tchar)(*(self)->parse) )
 C runtime clone of isspace.
#define ctl_sconst_isupper(tchar, self)   ( cisupper(tchar)(*(self)->parse) )
 C runtime clone of isupper.
#define ctl_sconst_isprint(tchar, self)   ( cisprint(tchar)(*(self)->parse) )
 C runtime clone of isprint.
#define ctl_sconst_isxdigit(tchar, self)   ( cisxdigit(tchar)(*(self)->parse) )
 C runtime clone of isxdigit.
#define ctl_sconst_left(tchar, self, cstr_left, count)
 A bit like left$ in BASIC, except it produces a const substring.
#define ctl_sconst_right(tchar, self, cstr_right, count)
 A bit like right$ in BASIC, except it produces a const substring.
#define ctl_sconst_mid(tchar, self, cstr_mid, offset, count)
 A bit like mid$ in BASIC, except it produces a const substring.
#define ctl_sconst_strchr(tchar, self, ch)   ctl_sconst_(tchar,strchr)( self, ch )
 Look for a character in a string.
#define ctl_sconst_strichr(tchar, self, ch)   ctl_sconst_(tchar,strichr)( self, ch )
 Look for a character in a string; case insensitive.
#define ctl_sconst_strstr(tchar, self, sz)   ctl_sconst_(tchar,strstr)( self, sz )
 Look for a string in a string.
#define ctl_sconst_stristr(tchar, self, sz)   ctl_sconst_(tchar,stristr)( self, sz )
 Look for a string in a string; case insensitive.
#define ctl_sconst_dmatch(tchar, self, substring, chOpen, chClose)   ctl_sconst_(tchar,dmatch)( self, substring, chOpen, chClose )
 Search for a block of text enclosed by two symbols, such as (), {} or [] The depth of opening types is matched to the depth of closing types.
#define ctl_sconst_dmatchstr(tchar, self, substring, szOpen, szClose)   ctl_sconst_(tchar,dmatchstr)( self, substring, szOpen, szClose )
 Search for a block of text enclosed by two strings, such as "<",/>" "begin","end".
#define ctl_sconst_strpbrk(tchar, self, szSet)   ctl_sconst_(tchar,strpbrk)( self, szSet )
 Look for any one of the characters in szSet in this string starting at parse point.
#define ctl_sconst_skipspace(tchar, self)   ctl_sconst_(tchar,skipspace)( self )
 Skip over any white space.
#define ctl_sconst_nextspace(tchar, self)   ctl_sconst_(tchar,nextspace)( self )
 Skip over any NON-white space until we find a space.
#define ctl_sconst_findclass(tchar, self, classname)   ctl_sconst_(tchar,ppConcat(find_,classname))( self )
 Find the next instance of a character class ala ctype.h.
#define ctl_sconst_findnotclass(tchar, self, classname)   ctl_sconst_(tchar,ppConcat(find_not_,classname))( self )
 Find the next instance that is not of a character class ala ctype.h.
#define ctl_sconst_scanclass(tchar, self, found, classname)   ctl_sconst_(tchar,ppConcat(scan_,classname))( self, found )
 Scan for a block of characters that are of a class type.
#define ctl_sconst_scannotclass(tchar, self, found, classname)   ctl_sconst_(tchar,ppConcat(scan_not_,classname))( self, found )
 Scan for a block of characters that are NOT of a class type.
#define ctl_sconst_strcmp(tchar, self, sz)   ctl_sconst_(tchar,strcmp)( self, sz )
 Do a string comparison at parse point.
#define ctl_sconst_stricmp(tchar, self, sz)   ctl_sconst_(tchar,stricmp)( self, sz )
 Do a case insensitive string comparison at parse point.
#define ctl_sconst_strncmp(tchar, self, sz, count)   ctl_sconst_(tchar,strncmp)( self, sz, count )
 Do a string comparison at parse point.
#define ctl_sconst_strnicmp(tchar, self, sz, count)   ctl_sconst_(tchar,strnicmp)( self, sz, count )
 Do a case insensitive string comparison at parse point.
#define ctl_sconst_compare(tchar, p1, p2)   ctl_sconst_(tchar,compare)( (p1),(p2) )
 Do a string comparison at parse point.
#define ctl_sconst_rcompare(tchar, p1, p2)   ctl_sconst_(tchar,compare)( (p2),(p1) )
 Do a string reverse comparison at parse point.
#define ctl_sconst_icompare(tchar, self, other)   ctl_sconst_(tchar,icompare)( (self), (other) )
 Do a case insensitive string comparison at parse point.
#define ctl_sconst_getbool(tchar, self, pValue)   ctl_sconst_(tchar,getbool)( self, pValue )
 Decode a boolean; any decimal number, true/on, false/off will do.
#define ctl_sconst_getint8(tchar, self, pValue)   ctl_sconst_(tchar,getint8)( self, pValue )
 Decode a value.
#define ctl_sconst_getuint8(tchar, self, pValue)   ctl_sconst_(tchar,getuint8)( self, pValue )
 Decode a value.
#define ctl_sconst_getint16(tchar, self, pValue)   ctl_sconst_(tchar,getint16)( self, pValue )
 Decode a value.
#define ctl_sconst_getuint16(tchar, self, pValue)   ctl_sconst_(tchar,getuint16)( self, pValue )
 Decode a value.
#define ctl_sconst_getint32(tchar, self, pValue)   ctl_sconst_(tchar,getint32)( self, pValue )
 Decode a value.
#define ctl_sconst_getuint32(tchar, self, pValue)   ctl_sconst_(tchar,getuint32)( self, pValue )
 Decode a value.
#define ctl_sconst_getint64(tchar, self, pValue)   ctl_sconst_(tchar,getint64)( self, pValue )
 Decode a value.
#define ctl_sconst_getuint64(tchar, self, pValue)   ctl_sconst_(tchar,getuint64)( self, pValue )
 Decode a value.
#define ctl_sconst_getfloat32(tchar, self, pValue)   ctl_sconst_(tchar,getfloat32)( self, pValue )
 Decode a value.
#define ctl_sconst_getfloat64(tchar, self, pValue)   ctl_sconst_(tchar,getfloat64)( self, pValue )
 Decode a value.
#define ctl_sconst_getxbool(tchar, self, pValue)   ctl_sconst_(tchar,getbool)( self, pValue )
 Decode an 8 bit hexadecimal value, stopping at 2 digits.
#define ctl_sconst_getxint8(tchar, self, pValue)   ctl_sconst_(tchar, getxint8 )( self, pValue )
 Decode an 8 bit hexadecimal value, stopping at 2 digits.
#define ctl_sconst_getxuint8(tchar, self, pValue)   ctl_sconst_(tchar, getxuint8 )( self, pValue )
 Decode an 8 bit hexadecimal value, stopping at 2 digits.
#define ctl_sconst_getxint16(tchar, self, pValue)   ctl_sconst_(tchar, getxint16 )( self, pValue )
 Decode a 16 bit hexadecimal value, stopping at 4 digits.
#define ctl_sconst_getxuint16(tchar, self, pValue)   ctl_sconst_(tchar, getxuint16 )( self, pValue )
 Decode a 16 bit hexadecimal value, stopping at 4 digits.
#define ctl_sconst_getxint32(tchar, self, pValue)   ctl_sconst_(tchar, getxuint32 )( self, (uint32*)(pValue), 8 )
 Decode a 32 bit hexadecimal value, stopping at 8 digits.
#define ctl_sconst_getxuint32(tchar, self, pValue)   ctl_sconst_(tchar, getxuint32 )( self, pValue, 8 )
 Decode a 32 bit hexadecimal value, stopping at 8 digits.
#define ctl_sconst_getxint64(tchar, self, pValue)   ctl_sconst_(tchar, getxuint64 )( self, (uint64*)(pValue), 16 )
 Decode a 64 bit hexadecimal value, stopping at 16 digits.
#define ctl_sconst_getxuint64(tchar, self, pValue)   ctl_sconst_(tchar, getxuint64 )( self, pValue, 16 )
 Decode a 64 bit hexadecimal value, stopping at 16 digits.
#define ctl_sconst_getxn(tchar, self, pValue, numDigits)   ctl_sconst_(tchar, getx64 )( self, pValue, numDigits )
 Decode a hexadecimal value up to 32 bits (8 digits), limiting to some arbitrary number of places of precision Useful for places where we simply append hexadecimal data together at fixed widths.
#define ctl_sconst_getxnn(tchar, self, pValue, numDigits)   ctl_sconst_(tchar, getx64 )( self, pValue, numDigits )
 Decode a hexadecimal value up to 64 bits (16 digits), limiting to some arbitrary number of places of precision Useful for places where we simply append hexadecimal data together at fixed widths.
#define ctl_sconst_getenum(tchar, self, pValue, szz)   ctl_sconst_(tchar,getenum)( self, pValue, szz )
 Decode one of a set of possible strings to an index into that set.
#define ctl_sconst_getienum(tchar, self, pValue, szz)   ctl_sconst_(tchar,getienum)( self, pValue, szz )
 Decode one of a set of possible strings to an index into that set, case insensitive.
#define ctldecl_ctl_sconst(tchar)
 Declare a constant string parser class of functionality.
#define DEF_Supported_Class_Scans(tchar, def)
 This is the generator template list for scanning for character types ala ctype.h; add your custom handlers here to extend it, if you like.
#define ctl_sconst_foreach(tchar, self, iterator)
 Iterate the characters in the string from beginning to end.
#define ctl_sconst_foreach_reverse(tchar, self, iterator)
 Iterate the characters in the string from end to beginning.
#define chconst(tchar, ch)   ppConcat(chconst_,tchar)(ch)
 Make the "correct" kind of character constant by template tchar.
#define szconst(tchar, sz)   ppConcat(szconst_,tchar)(sz)
 Make the "correct" kind of string constant by template tchar.
#define szconvert(tchardst, tcharsrc)   (ch) ppConcat3(szconvert_,tchardst,tcharsrc)
 Convert from wchar_t<->char.
#define szstrfmt(tchar)   ppConcat(szstrfmt_,tchar)
 The 'standard' format is for ls when receiving wchar_t strings, and s when receiving char strings.
#define ctl_chsize(tchar, length)   (ppCtypeSelect(tchar,(size_t)(length),(length)*sizeof(tchar)))
 Calculate size of a string in bytes, based on character template.
#define ctl_chlength(tchar, size)   (ppCtypeSelect(tchar,(size_t)(size),(size)/sizeof(tchar)))
 Calculate length of a string in characters from its memory size, based on character template.
#define ppCtypeSelect(tchar, xchar, xwchar_t)   ppConcat(_ppCtypeSelect_,tchar)(xchar,xwchar_t)
 Make selection logic for character type handler a little more compact.
#define chssize(tchar, length)   (ppCtypeSelect(tchar,(size_t)(length),(length)*2))
 Work out a string's serial size from its length.
#define chslength(tchar, size)   (ppCtypeSelect(tchar,(size_t)(size),(size)/2))
 Work out a string's length from its serial size.
#define cmemcpy(tchar, sDst, sSrc, count)   memcpy( (sDst),(sSrc),ctl_chsize(tchar,count) )
 Copy part of a string, ignoring NUL terminator.
#define cmemmove(tchar, sDst, sSrc, count)   memmove( (sDst),(sSrc),ctl_chsize(tchar,count) )
 Copy part of a string, ignoring NUL terminator, may be overlapped.
#define ctl_fstring(tchar)   ctl_mstring(tchar,fixed)
 This is the mutable string that stays the same size When you hit the limit imposed at instantiation, that's all you ever get.
#define ctl_fstring_destroy(tchar, self)
 Function to de-initialize fixed buffer (NOP).
#define ctl_fstring_auto(tchar, size, label)
 Make string on stack or as a global, with buffer Uses non-standard ANSI extensions: non-const initializers.
#define ctl_fstring_auto_buff(tchar, buff, size, label)   ctl_mstring(tchar,fixed) label = {(buff),(buff),(buff)+(size)-1}
 Initialize from a NUL terminated string pointer Uses non-standard ANSI extensions: non-const initializers.
#define ctl_fstring_init(tchar, self, buff, len)
 Initialize from a NUL terminated string pointer.
#define ctl_fstring_init_sz(tchar, self, sz)
 Initialize from a NUL terminated string pointer.
#define ctl_fstring_swap(tchar, p1, p2)
 Swap two fstrings -.
#define ctl_fstring_move(tchar, p1, p2)
 Move contents of one string to another.
#define ctl_fstring_remain(tchar, self)   ( (self)->endBuff - (self)->end )
 Tell how much bigger the string can get.
#define ctl_fstring_size(tchar, self)   ((size_t)( (self)->end - (self)->begin ))
 Tell how many characters are in the string, right now.
#define ctl_fstring_maxsize(tchar, self)   ((size_t)( (self)->endBuff - (self)->begin ))
 Tell how many total characters can be put in the string.
#define ctl_fstring_reset(tchar, self)   ( *((self)->end = (self)->begin) = 0 )
 Reset parse point to beginning.
#define ctl_fstring_begin(tchar, self)   ( (self)->begin )
 Point at start of string.
#define ctl_fstring_end(tchar, self)   ( (self)->end )
 Point to the end of the string.
#define ctl_fstring_fill(tchar, self, fillVal, count)   ctl_mstring_(tchar,fixed, fill )((self), (fillVal), (count) )
 Fill string at parse point with a given number of characters.
#define ctl_fstring_add(tchar, self, ch)   ctl_mstring_(tchar,fixed, fill )((self), (ch), 1 )
 Fill string at parse point with a given number of characters.
#define ctl_fstring_filltab(tchar, self, fillVal, tabPos)   ctl_mstring_(tchar,fixed, filltab )((self), (fillVal), (tabPos) )
 Fill to some tab position with a given number of characters.
#define ctl_fstring_putbool(tchar, self, value)   ctl_mstring_(tchar,fixed, strncat )((self),(value) ? szconst(tchar,"true") : szconst(tchar,"false"), ~0u )
 Write a boolean as "true" or "false".
#define ctl_fstring_putboolyesno(tchar, self, value)   ctl_mstring_(tchar,fixed, strncat )((self),(value) ? szconst(tchar,"yes") : szconst(tchar,"no"), ~0u )
 Write a boolean as "yes" or "no".
#define ctl_fstring_putboolonoff(tchar, self, value)   ctl_mstring_(tchar,fixed, strncat )((self),(value) ? szconst(tchar,"on") : szconst(tchar,"off"), ~0u )
 Write a boolean as "on" or "off".
#define ctl_fstring_putbool10(tchar, self, value)   ctl_mstring_(tchar,fixed, strncat )((self),(value) ? szconst(tchar,"1") : szconst(tchar,"0"), ~0u )
 Write a boolean as "1" or "0".
#define ctl_fstring_putint8(tchar, self, value)   ctl_mstring_(tchar,fixed, putint32 )((self),(int32)(int8)(value) )
 Write a value as a decimal number.
#define ctl_fstring_putuint8(tchar, self, value)   ctl_mstring_(tchar,fixed, putuint32 )((self),(uint32)(uint8)(value) )
 Write a value as a decimal number.
#define ctl_fstring_putint16(tchar, self, value)   ctl_mstring_(tchar,fixed, putint32 )((self),(int32)(int16)(value) )
 Write a value as a decimal number.
#define ctl_fstring_putuint16(tchar, self, value)   ctl_mstring_(tchar,fixed, putuint32 )((self),(uint32)(uint16)(value) )
 Write a value as a decimal number.
#define ctl_fstring_putint32(tchar, self, value)   ctl_mstring_(tchar,fixed, putint32 )((self),(value) )
 Write a value as a decimal number.
#define ctl_fstring_putuint32(tchar, self, value)   ctl_mstring_(tchar,fixed, putuint32 )((self),(value) )
 Write a value as a decimal number.
#define ctl_fstring_putint64(tchar, self, value)   ctl_mstring_(tchar,fixed, putint64 )((self),(value) )
 Write a value as a decimal number.
#define ctl_fstring_putuint64(tchar, self, value)   ctl_mstring_(tchar,fixed, putuint64 )((self),(value) )
 Write a value as a decimal number.
#define ctl_fstring_putfloat32(tchar, self, value)   ctl_mstring_(tchar,fixed, putfloat64 )((self),(value) )
 Write a floating point value as a decimal number.
#define ctl_fstring_putfloat64(tchar, self, value)   ctl_mstring_(tchar,fixed, putfloat64 )((self),(value) )
 Write a floating point value as a decimal number.
#define ctl_fstring_putxint8(tchar, self, value)   ctl_mstring_(tchar,fixed, putxuint32 )((self),(uint32)(value), 2 )
 Write a value as a hexadecimal number.
#define ctl_fstring_putxint16(tchar, self, value)   ctl_mstring_(tchar,fixed, putxuint32 )((self),(uint32)(value), 4 )
 Write a value as a hexadecimal number.
#define ctl_fstring_putxint32(tchar, self, value)   ctl_mstring_(tchar,fixed, putxuint32 )((self),(uint32)(value), 8 )
 Write a value as a hexadecimal number.
#define ctl_fstring_putxint64(tchar, self, value)   ctl_mstring_(tchar,fixed, putxuint64 )((self),(uint32)(value), 16 )
 Write a value as a hexadecimal number.
#define ctl_fstring_putxuint8(tchar, self, value)   ctl_mstring_(tchar,fixed, putxuint32 )((self),(uint32)(value), 2 )
 Write a value as a hexadecimal number.
#define ctl_fstring_putxuint16(tchar, self, value)   ctl_mstring_(tchar,fixed, putxuint32 )((self),(value), 4 )
 Write a value as a hexadecimal number.
#define ctl_fstring_putxuint32(tchar, self, value)   ctl_mstring_(tchar,fixed, putxuint32 )((self),(value), 8 )
 Write a value as a hexadecimal number.
#define ctl_fstring_putxuint64(tchar, self, value)   ctl_mstring_(tchar,fixed, putxuint64 )((self),(value), 16 )
 Write a value as a hexadecimal number.
#define ctl_fstring_putenum(tchar, self, value, szzList, szUndefined)   ctl_mstring_(tchar,fixed, putenum )((self),(value),(szzList), countof(szzList),(szUndefined) )
 Write an enumerated value.
#define ctl_fstring_putenum_max(tchar, self, value, szzList, max, szUndefined)   ctl_mstring_(tchar,grow, putenum )((self),(value),(szzList), (max), (szUndefined) )
 Write an enumerated value.
#define ctl_fstring_strcat(tchar, self, sz)   ctl_mstring_(tchar,fixed, strncat )((self),(sz), ~0u )
 Concatenate a string onto this at parse.
#define ctl_fstring_strcpy(tchar, self, sz)   ctl_mstring_(tchar,fixed, strncpy )((self),(sz), ~0u )
 Copy another string on top of this, setting the parse point after sz.
#define ctl_fstring_strncat(tchar, self, sz, maxLen)   ctl_mstring_(tchar,fixed, strncat )((self),(sz),(maxLen) )
 Concatenate a string onto this at parse.
#define ctl_fstring_strncpy(tchar, self, sz, maxLen)   ctl_mstring_(tchar,fixed, strncpy )((self),(sz),(maxLen) )
 Copy another string on top of this, setting the parse point and end after sz.
#define ctl_fstring_strinsert(tchar, self, position, sz)   ctl_mstring_(tchar,fixed, strninsert )((self),(position),(sz), 0u )
 Insert a string at parse; anything between 'position' and 'parse' is maintained AFTER inserted string.
#define ctl_fstring_strninsert(tchar, self, position, sz, maxLen)   ctl_mstring_(tchar,fixed, strninsert )((self),(position),(sz),(maxLen) )
 Insert a string at parse; anything between 'position' and 'parse' is maintained AFTER inserted string.
#define ctl_fstring_vsprintf(tchar, self, fmt, args)   ctl_mstring_(tchar,fixed, vsprintf )((self),(fmt),(args) )
 Add/overwrite text at parse ala vsprintf formatting arguments.
#define ctl_fstring_sprintf(tchar, selffmtargs)   ctl_mstring_(tchar,fixed, sprintf ) selffmtargs
 Add/overwrite text at parse ala sprintf formatting arguments.
#define ctl_fstring_makeClabel(tchar, self)   ctl_mstring_(tchar,fixed, makeClabel )( (self) )
 Convert contents into something label-friendly for C.
#define ctl_fstring_truncate(tchar, self, newsize)   ctl_mstring_(tchar,fixed, truncate )( (self), (newsize) )
 Truncate a string's trailing characters.
#define ctl_fstring_foreach(tchar, self, iterator)
 Iterate the characters in the string from beginning to end.
#define ctl_fstring_foreach_reverse(tchar, self, iterator)
 Iterate the characters in the string from end to beginning.
#define ctl_gstring(tchar)   ctl_mstring(tchar,grow)
 This is the mutable string that stays the same size When you hit the limit imposed at instantiation, that's all you ever get.
#define ctl_gstring_destroy(tchar, self)
 Function to de-initialize growable buffer.
#define ctl_gstring_auto(tchar, label)   ctl_mstring(tchar,grow) label = {(tchar*)ctl_mstring_(tchar,grow,0),(tchar*)ctl_mstring_(tchar,grow,0),(tchar*)ctl_mstring_(tchar,grow,0)}
 Initialize from a NUL terminated string pointer Uses non-standard ANSI extension: non-const initializers.
#define ctl_gstring_init(tchar, self)   (self)->begin = (self)->end = (self)->endBuff = (tchar*)ctl_mstring_(tchar,grow,0)\
 Initialize from a NUL terminated string pointer.
#define ctl_gstring_init_sz(tchar, self, sz)
 Initialize from a NUL terminated string pointer.
#define ctl_gstring_init_cstring(tchar, self, cstr)
 Initialize from a constant string.
#define ctl_gstring_swap(tchar, p1, p2)
 Swap two fstrings -.
#define ctl_gstring_move(tchar, p1, p2)
 Move contents of one string to another.
#define ctl_gstring_remain(tchar, self)   ( (self)->endBuff - (self)->end )
 Tell how much bigger the string can get before it reallocates.
#define ctl_gstring_size(tchar, self)   ((size_t)( (self)->end - (self)->begin ))
 Tell how many characters are in the string, right now.
#define ctl_gstring_reset(tchar, self)   { if( (self)->begin != ctl_mstring_(tchar,grow,0) ) { (self)->end = (self)->begin; *(self)->begin = 0; } }
 Reset parse point to beginning.
#define ctl_gstring_begin(tchar, self)   ( (self)->begin )
 Point at start of string.
#define ctl_gstring_end(tchar, self)   ( (self)->end )
 Point to the end of the string.
#define ctl_gstring_resize(tchar, self, count)   { ctl_mstring_(tchar,grow, grow )( (self), (count) - ((self)->end-(self)->begin) ); *((self)->end = (self)->begin+(count)) = 0; }
 Grow or shrink a string, in preparation for some external copy/operation.
#define ctl_gstring_fill(tchar, self, fillVal, count)   ctl_mstring_(tchar,grow, fill )((self), (fillVal), (count) )
 Fill string at parse point with a given number of characters.
#define ctl_gstring_add(tchar, self, ch)   ctl_mstring_(tchar,grow, fill )((self), (ch), 1 )
 Fill string at parse point with a given number of characters.
#define ctl_gstring_filltab(tchar, self, fillVal, tabPos)   ctl_mstring_(tchar,grow, filltab )((self), (fillVal), (tabPos) )
 Fill to some tab position with a given number of characters.
#define ctl_gstring_putbool(tchar, self, value)   ctl_mstring_(tchar,grow, strncat )((self),(value) ? szconst(tchar,"true") : szconst(tchar,"false"), ~0u )
 Write a boolean as "true" or "false".
#define ctl_gstring_putboolyesno(tchar, self, value)   ctl_mstring_(tchar,grow, strncat )((self),(value) ? szconst(tchar,"yes") : szconst(tchar,"no"), ~0u )
 Write a boolean as "yes" or "no".
#define ctl_gstring_putboolonoff(tchar, self, value)   ctl_mstring_(tchar,grow, strncat )((self),(value) ? szconst(tchar,"on") : szconst(tchar,"off"), ~0u )
 Write a boolean as "on" or "off".
#define ctl_gstring_putbool10(tchar, self, value)   ctl_mstring_(tchar,grow, strncat )((self),(value) ? szconst(tchar,"1") : szconst(tchar,"0"), ~0u )
 Write a boolean as "1" or "0".
#define ctl_gstring_putint8(tchar, self, value)   ctl_mstring_(tchar,grow, putint32 )((self),(int32)(int8)(value) )
 Write a value as a decimal number.
#define ctl_gstring_putuint8(tchar, self, value)   ctl_mstring_(tchar,grow, putuint32 )((self),(uint32)(uint8)(value) )
 Write a value as a decimal number.
#define ctl_gstring_putint16(tchar, self, value)   ctl_mstring_(tchar,grow, putint32 )((self),(int32)(int16)(value) )
 Write a value as a decimal number.
#define ctl_gstring_putuint16(tchar, self, value)   ctl_mstring_(tchar,grow, putuint32 )((self),(uint32)(uint16)(value) )
 Write a value as a decimal number.
#define ctl_gstring_putint32(tchar, self, value)   ctl_mstring_(tchar,grow, putint32 )((self),(value) )
 Write a value as a decimal number.
#define ctl_gstring_putuint32(tchar, self, value)   ctl_mstring_(tchar,grow, putuint32 )((self),(value) )
 Write a value as a decimal number.
#define ctl_gstring_putint64(tchar, self, value)   ctl_mstring_(tchar,grow, putint64 )((self),(value) )
 Write a value as a decimal number.
#define ctl_gstring_putuint64(tchar, self, value)   ctl_mstring_(tchar,grow, putuint64 )((self),(value) )
 Write a value as a decimal number.
#define ctl_gstring_putfloat32(tchar, self, value)   ctl_mstring_(tchar,grow, putfloat64 )((self),(value) )
 Write a floating point value as a decimal number.
#define ctl_gstring_putfloat64(tchar, self, value)   ctl_mstring_(tchar,grow, putfloat64 )((self),(value) )
 Write a floating point value as a decimal number.
#define ctl_gstring_putxint8(tchar, self, value)   ctl_mstring_(tchar,grow, putxuint32 )((self),(uint32)(value), 2 )
 Write a value as a hexadecimal number.
#define ctl_gstring_putxint16(tchar, self, value)   ctl_mstring_(tchar,grow, putxuint32 )((self),(uint32)(value), 4 )
 Write a value as a hexadecimal number.
#define ctl_gstring_putxint32(tchar, self, value)   ctl_mstring_(tchar,grow, putxuint32 )((self),(uint32)(value), 8 )
 Write a value as a hexadecimal number.
#define ctl_gstring_putxint64(tchar, self, value)   ctl_mstring_(tchar,grow, putxuint64 )((self),(uint32)(value), 16 )
 Write a value as a hexadecimal number.
#define ctl_gstring_putxuint8(tchar, self, value)   ctl_mstring_(tchar,grow, putxuint32 )((self),(uint32)(value), 2 )
 Write a value as a hexadecimal number.
#define ctl_gstring_putxuint16(tchar, self, value)   ctl_mstring_(tchar,grow, putxuint32 )((self),(value), 4 )
 Write a value as a hexadecimal number.
#define ctl_gstring_putxuint32(tchar, self, value)   ctl_mstring_(tchar,grow, putxuint32 )((self),(value), 8 )
 Write a value as a hexadecimal number.
#define ctl_gstring_putxuint64(tchar, self, value)   ctl_mstring_(tchar,grow, putxuint64 )((self),(value), 16 )
 Write a value as a hexadecimal number.
#define ctl_gstring_putenum(tchar, self, value, szzList, szUndefined)   ctl_mstring_(tchar,grow, putenum )((self),(value),(szzList), countof(szzList),(szUndefined) )
 Write an enumerated value.
#define ctl_gstring_putenum_max(tchar, self, value, szzList, max, szUndefined)   ctl_mstring_(tchar,grow, putenum )((self),(value),(szzList), (max), (szUndefined) )
 Write an enumerated value.
#define ctl_gstring_strcat(tchar, self, sz)   ctl_mstring_(tchar,grow, strncat )((self),(sz), ~0u )
 Concatenate a string onto this at parse.
#define ctl_gstring_strcpy(tchar, self, sz)   ctl_mstring_(tchar,grow, strncpy )((self),(sz), ~0u )
 Copy another string on top of this, setting the parse point after sz.
#define ctl_gstring_strncat(tchar, self, sz, maxLen)   ctl_mstring_(tchar,grow, strncat )((self),(sz),(maxLen) )
 Concatenate a string onto this at parse.
#define ctl_gstring_strncpy(tchar, self, sz, maxLen)   ctl_mstring_(tchar,grow, strncpy )((self),(sz),(maxLen) )
 Copy another string on top of this, setting the parse point and end after sz.
#define ctl_gstring_strinsert(tchar, self, position, sz)   ctl_mstring_(tchar,grow, strninsert )((self),(position),(sz), 0u )
 Insert a string at parse; anything between 'position' and 'parse' is maintained AFTER inserted string.
#define ctl_gstring_strninsert(tchar, self, position, sz, maxLen)   ctl_mstring_(tchar,grow, strninsert )((self),(position),(sz),(maxLen) )
 Insert a string at parse; anything between 'position' and 'parse' is maintained AFTER inserted string.
#define ctl_gstring_vsprintf(tchar, self, fmt, args)   ctl_mstring_(tchar,grow, vsprintf )((self),(fmt),(args) )
 Add/overwrite text at parse ala vsprintf formatting arguments.
#define ctl_gstring_sprintf(tchar, selffmtargs)   ctl_mstring_(tchar,grow, sprintf ) selffmtargs
 Add/overwrite text at parse ala sprintf formatting arguments.
#define ctl_gstring_makeClabel(tchar, self)   ctl_mstring_(tchar,grow, makeClabel )( (self) )
 Convert contents into something label-friendly for C.
#define ctl_gstring_truncate(tchar, self, newsize)   ctl_mstring_(tchar,grow, truncate )( (self), (newsize) )
 Truncate a string's trailing characters.
#define ctl_gstring_compare(tchar, p1, p2)   ctl_mstring_(tchar,grow, compare )( p1, p2 )
 Compare two strings for qsort.
#define ctl_gstring_rcompare(tchar, p1, p2)   ctl_mstring_(tchar,grow, rcompare )( p1, p2 )
 Compare two strings for qsort.
#define ctl_gstring_foreach(tchar, self, iterator)
 Iterate the characters in the string from beginning to end.
#define ctl_gstring_foreach_reverse(tchar, self, iterator)
 Iterate the characters in the string from end to beginning.
#define ctl_mstring(tchar, handler)   ppConcat4(ctl_mstring_,tchar,_,handler)
 Get class name from base name and character type.
#define ctl_mstring_(tchar, handler, function)   ppConcat3(ctl_mstring(tchar,handler),_,function)
 Build the function name from character type and root class.
#define ctldecl_ctl_mstring(tchar, handler)
 Base class for ctl_fstring and ctl_string.

Functions

struct ppConcat (ctl_sconst_, char)
 Constant substring parser class\.
struct ppConcat (ctl_sconst_, wchar_t)
 Constant substring parser class\.
bool ctl_sconst_ (tchar, strchr)(ctl_sconst(tchar)*self
 Look for a character in a string tchar Template: type of string we're working with self Instance of string we're operating on (like 'this' in C++) ch What character we're seeking.
struct ppConcat4 (ctl_mstring_, char, _, grow)
 Mutable string class.
struct ppConcat4 (ctl_mstring_, wchar_t, _, grow)
 Mutable string class.
struct ppConcat4 (ctl_mstring_, char, _, fixed)
 Mutable string class.
struct ppConcat4 (ctl_mstring_, wchar_t, _, fixed)
 Mutable string class.
 ctl_mstring_xgrow (tchar, handler, const tchar ctl_mstring_(tchar, handler, 0)[1]=szconst(tchar,"");) void ctl_mstring_(tchar
 See if the string needs to grow, grow it according to templats
(tchar,handler) Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
addLen How much to grow by
.
 _growcode (tchar, self, addLen) void ctl_mstring_(tchar
 Fill string at parse point with a given number of characters
(tchar,handler) Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
fillVal Fill character value to repeat count How many times to repeat.
void ctl_mstring_ (tchar, handler, filltab)(ctl_mstring(tchar
 Fill to some tab position with a given number of characters
(tchar,handler) Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
fillVal Fill character tabPos If this is 10, and parse is <10 chars from begin, this will fill up to 10.

Define Documentation

#define chconst ( tchar,
ch   )     ppConcat(chconst_,tchar)(ch)

#define chslength ( tchar,
size   )     (ppCtypeSelect(tchar,(size_t)(size),(size)/2))

Work out a string's length from its serial size.

Parameters:
tchar Type of character string
size Size of string

Definition at line 164 of file ctlstring.h.

Referenced by char_record_read_gstring(), char_serial_read_fstring(), char_serial_read_gstring(), wchar_t_record_read_gstring(), wchar_t_serial_read_fstring(), and wchar_t_serial_read_gstring().

#define chssize ( tchar,
length   )     (ppCtypeSelect(tchar,(size_t)(length),(length)*2))

Work out a string's serial size from its length.

Parameters:
tchar Type of character string
length Length of string

Definition at line 156 of file ctlstring.h.

Referenced by char_record_size_gstring(), char_record_size_string(), wchar_t_record_size_gstring(), wchar_t_record_size_string(), and wchar_t_record_write_string().

#define cmemcpy ( tchar,
sDst,
sSrc,
count   )     memcpy( (sDst),(sSrc),ctl_chsize(tchar,count) )

Copy part of a string, ignoring NUL terminator.

Parameters:
tchar Kind of char we are operating on (multiplies count by wchar_t as applicable)
sDst Where to copy to
sSrc Where to copy from
count How many characters to copy

Definition at line 263 of file ctlstring.h.

Referenced by char_xml_read_string().

#define cmemmove ( tchar,
sDst,
sSrc,
count   )     memmove( (sDst),(sSrc),ctl_chsize(tchar,count) )

Copy part of a string, ignoring NUL terminator, may be overlapped.

Parameters:
tchar Kind of char we are operating on (multiplies count by wchar_t as applicable)
sDst Where to copy to
sSrc Where to copy from
count How many characters to copy

Definition at line 273 of file ctlstring.h.

#define ctl_chlength ( tchar,
size   )     (ppCtypeSelect(tchar,(size_t)(size),(size)/sizeof(tchar)))

Calculate length of a string in characters from its memory size, based on character template.

Parameters:
tchar Template: type of string we're working with
size A size to convert to length
Returns:
size_t size of string in bytes

Definition at line 82 of file ctlstring.h.

Referenced by char_record_read_gstring().

#define ctl_chsize ( tchar,
length   )     (ppCtypeSelect(tchar,(size_t)(length),(length)*sizeof(tchar)))

Calculate size of a string in bytes, based on character template.

Parameters:
tchar Template: type of string we're working with
length A length to convert to size
Returns:
size_t size of string in bytes

Definition at line 73 of file ctlstring.h.

Referenced by char_xml_read_gstring().

#define ctl_fstring ( tchar   )     ctl_mstring(tchar,fixed)

This is the mutable string that stays the same size When you hit the limit imposed at instantiation, that's all you ever get.

Parameters:
tchar Template: type of string we're working with

Definition at line 20 of file fstring.h.

#define ctl_fstring_add ( tchar,
self,
ch   )     ctl_mstring_(tchar,fixed, fill )((self), (ch), 1 )

Fill string at parse point with a given number of characters.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
ch Character to append

Definition at line 186 of file fstring.h.

#define ctl_fstring_auto ( tchar,
size,
label   ) 

Value:

tchar ppConcat(buff_,label)[size] = szconst(tchar,"");\
    ctl_fstring_auto_buff(tchar, ppConcat(buff_,label), size, label )
Make string on stack or as a global, with buffer Uses non-standard ANSI extensions: non-const initializers.

Parameters:
tchar Template: type of string we're working with
size size_t length of buff
label What to call this instance

Definition at line 41 of file fstring.h.

#define ctl_fstring_auto_buff ( tchar,
buff,
size,
label   )     ctl_mstring(tchar,fixed) label = {(buff),(buff),(buff)+(size)-1}

Initialize from a NUL terminated string pointer Uses non-standard ANSI extensions: non-const initializers.

Parameters:
tchar Template: type of string we're working with
buff Externally declared buffer to parse into
size Length of that buffer in characters
label What to call this instance

Definition at line 54 of file fstring.h.

#define ctl_fstring_begin ( tchar,
self   )     ( (self)->begin )

Point at start of string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Pointer to start of this string

Definition at line 158 of file fstring.h.

#define ctl_fstring_destroy ( tchar,
self   ) 

Function to de-initialize fixed buffer (NOP).

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)

Definition at line 31 of file fstring.h.

#define ctl_fstring_end ( tchar,
self   )     ( (self)->end )

Point to the end of the string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Pointer to end of this string (not necessarily NUL)

Definition at line 167 of file fstring.h.

#define ctl_fstring_fill ( tchar,
self,
fillVal,
count   )     ctl_mstring_(tchar,fixed, fill )((self), (fillVal), (count) )

Fill string at parse point with a given number of characters.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
fillVal Fill character value to repeat
count How many times to repeat

Definition at line 177 of file fstring.h.

#define ctl_fstring_filltab ( tchar,
self,
fillVal,
tabPos   )     ctl_mstring_(tchar,fixed, filltab )((self), (fillVal), (tabPos) )

Fill to some tab position with a given number of characters.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
fillVal Fill character value to repeat
tabPos If this is 10, and parse is <10 chars from begin, this will fill up to 10

Definition at line 196 of file fstring.h.

#define ctl_fstring_foreach ( tchar,
self,
iterator   ) 

Value:

tchar* iterator = (self)->begin;\
    tchar* ppConcat(end_,iterator) = (self)->end;\
    for( ; iterator < ppConcat(end_,iterator); ++iterator )
Iterate the characters in the string from beginning to end.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
iterator What to call the iterator

Definition at line 527 of file fstring.h.

#define ctl_fstring_foreach_reverse ( tchar,
self,
iterator   ) 

Value:

tchar* iterator = (self)->end;\
    tchar* ppConcat(end_,iterator) = (self)->begin;\
    while( iterator-- < ppConcat(end_,iterator) )
Iterate the characters in the string from end to beginning.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
iterator What to call the iterator

Definition at line 539 of file fstring.h.

#define ctl_fstring_init ( tchar,
self,
buff,
len   ) 

Value:

{\
        (self)->begin = (self)->end = (buff);\
        (self)->endBuff = (self)->begin + (len)-1;\
        *(self)->begin = *(self)->endBuff = 0;\
    }
Initialize from a NUL terminated string pointer.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
buff Externally declared buffer to parse into
len Length of that buffer

Definition at line 65 of file fstring.h.

#define ctl_fstring_init_sz ( tchar,
self,
sz   ) 

Value:

{\
        (self)->begin = (self)->end = (buff);\
        (self)->endBuff = (self)->begin + (len);\
        ctl_fstring_strcpy(tchar, (self), (sz) );\
    }
Initialize from a NUL terminated string pointer.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
sz Pointer to a string

Definition at line 79 of file fstring.h.

#define ctl_fstring_makeClabel ( tchar,
self   )     ctl_mstring_(tchar,fixed, makeClabel )( (self) )

Convert contents into something label-friendly for C.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)

Definition at line 504 of file fstring.h.

#define ctl_fstring_maxsize ( tchar,
self   )     ((size_t)( (self)->endBuff - (self)->begin ))

Tell how many total characters can be put in the string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Characters in the whole set

Definition at line 140 of file fstring.h.

Referenced by char_serial_read_fstring(), and wchar_t_serial_read_fstring().

#define ctl_fstring_move ( tchar,
p1,
p2   ) 

Value:

{\
        (p1)->begin = (p2)->begin;\
        (p1)->end = (p2)->end;\
        (p1)->endBuff = (p2)->endBuff;\
        (p2)->begin = (p2)->end = (p2)->endBuff = NULL;\
    }
Move contents of one string to another.

Parameters:
tchar Template: type of string we're working with
p1 String to end up with contents of p2
p2 String to end up with contents of p1

Definition at line 107 of file fstring.h.

#define ctl_fstring_putbool ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, strncat )((self),(value) ? szconst(tchar,"true") : szconst(tchar,"false"), ~0u )

Write a boolean as "true" or "false".

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 205 of file fstring.h.

#define ctl_fstring_putbool10 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, strncat )((self),(value) ? szconst(tchar,"1") : szconst(tchar,"0"), ~0u )

Write a boolean as "1" or "0".

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 232 of file fstring.h.

#define ctl_fstring_putboolonoff ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, strncat )((self),(value) ? szconst(tchar,"on") : szconst(tchar,"off"), ~0u )

Write a boolean as "on" or "off".

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 223 of file fstring.h.

#define ctl_fstring_putboolyesno ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, strncat )((self),(value) ? szconst(tchar,"yes") : szconst(tchar,"no"), ~0u )

Write a boolean as "yes" or "no".

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 214 of file fstring.h.

#define ctl_fstring_putenum ( tchar,
self,
value,
szzList,
szUndefined   )     ctl_mstring_(tchar,fixed, putenum )((self),(value),(szzList), countof(szzList),(szUndefined) )

Write an enumerated value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write
szzList A NULL terminated list of strings to apply
szUndefined A(default) value to write when the passed value is out of range

Definition at line 405 of file fstring.h.

#define ctl_fstring_putenum_max ( tchar,
self,
value,
szzList,
max,
szUndefined   )     ctl_mstring_(tchar,grow, putenum )((self),(value),(szzList), (max), (szUndefined) )

Write an enumerated value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write
szzList A NULL terminated list of strings to apply
max A known maximum for the length of szzList, so we don't have to count.
szUndefined A (default) value to write when the passed value is out of range

Definition at line 417 of file fstring.h.

#define ctl_fstring_putfloat32 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putfloat64 )((self),(value) )

Write a floating point value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 313 of file fstring.h.

#define ctl_fstring_putfloat64 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putfloat64 )((self),(value) )

Write a floating point value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 322 of file fstring.h.

#define ctl_fstring_putint16 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putint32 )((self),(int32)(int16)(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 259 of file fstring.h.

#define ctl_fstring_putint32 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putint32 )((self),(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 277 of file fstring.h.

#define ctl_fstring_putint64 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putint64 )((self),(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 295 of file fstring.h.

#define ctl_fstring_putint8 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putint32 )((self),(int32)(int8)(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 241 of file fstring.h.

#define ctl_fstring_putuint16 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putuint32 )((self),(uint32)(uint16)(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 268 of file fstring.h.

#define ctl_fstring_putuint32 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putuint32 )((self),(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 286 of file fstring.h.

#define ctl_fstring_putuint64 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putuint64 )((self),(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 304 of file fstring.h.

#define ctl_fstring_putuint8 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putuint32 )((self),(uint32)(uint8)(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 250 of file fstring.h.

#define ctl_fstring_putxint16 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putxuint32 )((self),(uint32)(value), 4 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 340 of file fstring.h.

#define ctl_fstring_putxint32 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putxuint32 )((self),(uint32)(value), 8 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 349 of file fstring.h.

#define ctl_fstring_putxint64 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putxuint64 )((self),(uint32)(value), 16 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 358 of file fstring.h.

#define ctl_fstring_putxint8 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putxuint32 )((self),(uint32)(value), 2 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 331 of file fstring.h.

#define ctl_fstring_putxuint16 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putxuint32 )((self),(value), 4 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 376 of file fstring.h.

#define ctl_fstring_putxuint32 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putxuint32 )((self),(value), 8 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 385 of file fstring.h.

#define ctl_fstring_putxuint64 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putxuint64 )((self),(value), 16 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 394 of file fstring.h.

#define ctl_fstring_putxuint8 ( tchar,
self,
value   )     ctl_mstring_(tchar,fixed, putxuint32 )((self),(uint32)(value), 2 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 367 of file fstring.h.

#define ctl_fstring_remain ( tchar,
self   )     ( (self)->endBuff - (self)->end )

Tell how much bigger the string can get.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Count of characters that remain to be parsed

Definition at line 122 of file fstring.h.

#define ctl_fstring_reset ( tchar,
self   )     ( *((self)->end = (self)->begin) = 0 )

Reset parse point to beginning.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Pointer to start of string

Definition at line 149 of file fstring.h.

#define ctl_fstring_size ( tchar,
self   )     ((size_t)( (self)->end - (self)->begin ))

Tell how many characters are in the string, right now.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Characters in the whole set

Definition at line 131 of file fstring.h.

#define ctl_fstring_sprintf ( tchar,
selffmtargs   )     ctl_mstring_(tchar,fixed, sprintf ) selffmtargs

Add/overwrite text at parse ala sprintf formatting arguments.

Parameters:
tchar Template: type of string we're working with
selffmtargs Wrap selffmtargs in their own parentheses to group them, then pass them in, like certain macro implementations of trace
ctl_fstring_sprintf(char,fixed,("%d", iVal) );

Definition at line 496 of file fstring.h.

#define ctl_fstring_strcat ( tchar,
self,
sz   )     ctl_mstring_(tchar,fixed, strncat )((self),(sz), ~0u )

Concatenate a string onto this at parse.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
sz String to concatenate

Definition at line 426 of file fstring.h.

#define ctl_fstring_strcpy ( tchar,
self,
sz   )     ctl_mstring_(tchar,fixed, strncpy )((self),(sz), ~0u )

Copy another string on top of this, setting the parse point after sz.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
sz String to replace this with

Definition at line 435 of file fstring.h.

#define ctl_fstring_strinsert ( tchar,
self,
position,
sz   )     ctl_mstring_(tchar,fixed, strninsert )((self),(position),(sz), 0u )

Insert a string at parse; anything between 'position' and 'parse' is maintained AFTER inserted string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
position Where to insert
sz String to replace this with

Definition at line 465 of file fstring.h.

#define ctl_fstring_strncat ( tchar,
self,
sz,
maxLen   )     ctl_mstring_(tchar,fixed, strncat )((self),(sz),(maxLen) )

Concatenate a string onto this at parse.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
sz String to concatenate
maxLen Maximum count of characters to take from sz

Definition at line 445 of file fstring.h.

#define ctl_fstring_strncpy ( tchar,
self,
sz,
maxLen   )     ctl_mstring_(tchar,fixed, strncpy )((self),(sz),(maxLen) )

Copy another string on top of this, setting the parse point and end after sz.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
sz String to replace this with
maxLen Maximum count of characters to take from sz

Definition at line 455 of file fstring.h.

#define ctl_fstring_strninsert ( tchar,
self,
position,
sz,
maxLen   )     ctl_mstring_(tchar,fixed, strninsert )((self),(position),(sz),(maxLen) )

Insert a string at parse; anything between 'position' and 'parse' is maintained AFTER inserted string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
position Where to insert
sz String to replace this with
maxLen Maximum count of characters to take from sz

Definition at line 476 of file fstring.h.

#define ctl_fstring_swap ( tchar,
p1,
p2   ) 

Value:

{\
        ctl_fstring(tchar) tmp = *(p1);\
        *(p1) = *(p2);\
        *(p2) = tmp;\
    }
Swap two fstrings -.

Parameters:
tchar Template: type of string we're working with
p1 String to end up with contents of p2
p2 String to end up with contents of p1

Definition at line 93 of file fstring.h.

#define ctl_fstring_truncate ( tchar,
self,
newsize   )     ctl_mstring_(tchar,fixed, truncate )( (self), (newsize) )

Truncate a string's trailing characters.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
newsize Size string should be afterwards

Definition at line 513 of file fstring.h.

#define ctl_fstring_vsprintf ( tchar,
self,
fmt,
args   )     ctl_mstring_(tchar,fixed, vsprintf )((self),(fmt),(args) )

Add/overwrite text at parse ala vsprintf formatting arguments.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
fmt Printf string format argument
args Arguments to the printf, ala stdarg.h/vsprintf

Definition at line 486 of file fstring.h.

#define ctl_gstring ( tchar   )     ctl_mstring(tchar,grow)

This is the mutable string that stays the same size When you hit the limit imposed at instantiation, that's all you ever get.

Parameters:
tchar Template: type of string we're working with

Definition at line 24 of file gstring.h.

Referenced by ctl_xmlwrite_string_char(), ctl_xmlwrite_string_wchar_t(), and wchar_t_xml_read_string().

#define ctl_gstring_add ( tchar,
self,
ch   )     ctl_mstring_(tchar,grow, fill )((self), (ch), 1 )

Fill string at parse point with a given number of characters.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
ch Character to append

Definition at line 187 of file gstring.h.

Referenced by ctl_xmlread_getname(), ctl_xmlwrite_string_char(), ctl_xmlwrite_string_wchar_t(), wchar_t_xml_read_gstring(), and wchar_t_xml_read_string().

#define ctl_gstring_auto ( tchar,
label   )     ctl_mstring(tchar,grow) label = {(tchar*)ctl_mstring_(tchar,grow,0),(tchar*)ctl_mstring_(tchar,grow,0),(tchar*)ctl_mstring_(tchar,grow,0)}

Initialize from a NUL terminated string pointer Uses non-standard ANSI extension: non-const initializers.

Parameters:
tchar Template: type of string we're working with
label What to call the resulting instance

Definition at line 49 of file gstring.h.

#define ctl_gstring_begin ( tchar,
self   )     ( (self)->begin )

Point at start of string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Pointer to start of this string

Definition at line 150 of file gstring.h.

#define ctl_gstring_compare ( tchar,
p1,
p2   )     ctl_mstring_(tchar,grow, compare )( p1, p2 )

Compare two strings for qsort.

Parameters:
tchar Template: type of string we're working with
p1 first string
p2 next string
Returns:
<0 if p1<p2, >0 if p1>p2, 0 if p1==p2

Definition at line 524 of file gstring.h.

#define ctl_gstring_destroy ( tchar,
self   ) 

Value:

{\
        if( (self)->begin != ctl_mstring_(tchar,grow,0) ) \
            ctl_free((self)->begin); \
        (self)->begin = (self)->endBuff = (self)->end = (tchar*)ctl_mstring_(tchar,grow,0);\
    }
Function to de-initialize growable buffer.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)

Definition at line 35 of file gstring.h.

Referenced by ctl_xmlwrite_string_char(), ctl_xmlwrite_string_wchar_t(), and wchar_t_xml_read_string().

#define ctl_gstring_end ( tchar,
self   )     ( (self)->end )

Point to the end of the string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Pointer to end of this string (not necessarily NUL)

Definition at line 159 of file gstring.h.

#define ctl_gstring_fill ( tchar,
self,
fillVal,
count   )     ctl_mstring_(tchar,grow, fill )((self), (fillVal), (count) )

Fill string at parse point with a given number of characters.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
fillVal Fill character value to repeat
count How many times to repeat

Definition at line 178 of file gstring.h.

#define ctl_gstring_filltab ( tchar,
self,
fillVal,
tabPos   )     ctl_mstring_(tchar,grow, filltab )((self), (fillVal), (tabPos) )

Fill to some tab position with a given number of characters.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
fillVal Fill character value to repeat
tabPos If this is 10, and parse is <10 chars from begin, this will fill up to 10

Definition at line 197 of file gstring.h.

#define ctl_gstring_foreach ( tchar,
self,
iterator   ) 

Value:

tchar* iterator = (self)->begin;\
    tchar* ppConcat(end_,iterator) = (self)->end;\
    for( ; iterator < ppConcat(end_,iterator); ++iterator )
Iterate the characters in the string from beginning to end.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
iterator What to call the iterator

Definition at line 549 of file gstring.h.

#define ctl_gstring_foreach_reverse ( tchar,
self,
iterator   ) 

Value:

tchar* iterator = (self)->end;\
    tchar* ppConcat(end_,iterator) = (self)->begin;\
    while( iterator-- < ppConcat(end_,iterator) )
Iterate the characters in the string from end to beginning.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
iterator What to call the iterator

Definition at line 561 of file gstring.h.

#define ctl_gstring_init ( tchar,
self   )     (self)->begin = (self)->end = (self)->endBuff = (tchar*)ctl_mstring_(tchar,grow,0)\

Initialize from a NUL terminated string pointer.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)

Definition at line 58 of file gstring.h.

Referenced by ctl_xmlwrite_string_char(), ctl_xmlwrite_string_wchar_t(), and wchar_t_xml_read_string().

#define ctl_gstring_init_cstring ( tchar,
self,
cstr   ) 

Value:

{\
        (self)->begin = (self)->end = (self)->endBuff = (tchar*)ctl_mstring_(tchar,grow,0);\
        ctl_gstring_strncpy(tchar, (self), (cstr)->begin, (cstr)->end-(cstr)->begin );\
    }
Initialize from a constant string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
cstr Pointer to a const string to initialize from

Definition at line 81 of file gstring.h.

#define ctl_gstring_init_sz ( tchar,
self,
sz   ) 

Value:

{\
        (self)->begin = (self)->end = (self)->endBuff = (tchar*)ctl_mstring_(tchar,grow,0);\
        ctl_gstring_strcpy(tchar, (self), (sz) );\
    }
Initialize from a NUL terminated string pointer.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
sz Pointer to a string

Definition at line 68 of file gstring.h.

#define ctl_gstring_makeClabel ( tchar,
self   )     ctl_mstring_(tchar,grow, makeClabel )( (self) )

Convert contents into something label-friendly for C.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)

Definition at line 505 of file gstring.h.

#define ctl_gstring_move ( tchar,
p1,
p2   ) 

Value:

{\
        (p1)->begin = (p2)->begin;\
        (p1)->end = (p2)->end;\
        (p1)->endBuff = (p2)->endBuff;\
        (p2)->begin = (p2)->end = (p2)->endBuff = NULL;\
    }
Move contents of one string to another.

Parameters:
tchar Template: type of string we're working with
p1 String to end up with contents of p2
p2 String to end up with contents of p1

Definition at line 108 of file gstring.h.

#define ctl_gstring_putbool ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, strncat )((self),(value) ? szconst(tchar,"true") : szconst(tchar,"false"), ~0u )

Write a boolean as "true" or "false".

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 206 of file gstring.h.

#define ctl_gstring_putbool10 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, strncat )((self),(value) ? szconst(tchar,"1") : szconst(tchar,"0"), ~0u )

Write a boolean as "1" or "0".

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 233 of file gstring.h.

#define ctl_gstring_putboolonoff ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, strncat )((self),(value) ? szconst(tchar,"on") : szconst(tchar,"off"), ~0u )

Write a boolean as "on" or "off".

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 224 of file gstring.h.

#define ctl_gstring_putboolyesno ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, strncat )((self),(value) ? szconst(tchar,"yes") : szconst(tchar,"no"), ~0u )

Write a boolean as "yes" or "no".

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 215 of file gstring.h.

#define ctl_gstring_putenum ( tchar,
self,
value,
szzList,
szUndefined   )     ctl_mstring_(tchar,grow, putenum )((self),(value),(szzList), countof(szzList),(szUndefined) )

Write an enumerated value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write
szzList A NULL terminated list of strings to apply; assumes this is fully qualified with its length
szUndefined A (default) value to write when the passed value is out of range

Definition at line 406 of file gstring.h.

#define ctl_gstring_putenum_max ( tchar,
self,
value,
szzList,
max,
szUndefined   )     ctl_mstring_(tchar,grow, putenum )((self),(value),(szzList), (max), (szUndefined) )

Write an enumerated value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write
szzList A NULL terminated list of strings to apply
max A known maximum for the length of szzList, so we don't have to count.
szUndefined A (default) value to write when the passed value is out of range

Definition at line 418 of file gstring.h.

#define ctl_gstring_putfloat32 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putfloat64 )((self),(value) )

Write a floating point value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 314 of file gstring.h.

#define ctl_gstring_putfloat64 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putfloat64 )((self),(value) )

Write a floating point value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 323 of file gstring.h.

#define ctl_gstring_putint16 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putint32 )((self),(int32)(int16)(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 260 of file gstring.h.

#define ctl_gstring_putint32 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putint32 )((self),(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 278 of file gstring.h.

#define ctl_gstring_putint64 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putint64 )((self),(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 296 of file gstring.h.

#define ctl_gstring_putint8 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putint32 )((self),(int32)(int8)(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 242 of file gstring.h.

#define ctl_gstring_putuint16 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putuint32 )((self),(uint32)(uint16)(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 269 of file gstring.h.

#define ctl_gstring_putuint32 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putuint32 )((self),(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 287 of file gstring.h.

#define ctl_gstring_putuint64 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putuint64 )((self),(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 305 of file gstring.h.

#define ctl_gstring_putuint8 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putuint32 )((self),(uint32)(uint8)(value) )

Write a value as a decimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 251 of file gstring.h.

#define ctl_gstring_putxint16 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putxuint32 )((self),(uint32)(value), 4 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 341 of file gstring.h.

#define ctl_gstring_putxint32 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putxuint32 )((self),(uint32)(value), 8 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 350 of file gstring.h.

Referenced by ctl_xmlwrite_string_wchar_t().

#define ctl_gstring_putxint64 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putxuint64 )((self),(uint32)(value), 16 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 359 of file gstring.h.

#define ctl_gstring_putxint8 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putxuint32 )((self),(uint32)(value), 2 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 332 of file gstring.h.

#define ctl_gstring_putxuint16 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putxuint32 )((self),(value), 4 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 377 of file gstring.h.

#define ctl_gstring_putxuint32 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putxuint32 )((self),(value), 8 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 386 of file gstring.h.

#define ctl_gstring_putxuint64 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putxuint64 )((self),(value), 16 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 395 of file gstring.h.

#define ctl_gstring_putxuint8 ( tchar,
self,
value   )     ctl_mstring_(tchar,grow, putxuint32 )((self),(uint32)(value), 2 )

Write a value as a hexadecimal number.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
value Value to write

Definition at line 368 of file gstring.h.

#define ctl_gstring_rcompare ( tchar,
p1,
p2   )     ctl_mstring_(tchar,grow, rcompare )( p1, p2 )

Compare two strings for qsort.

Parameters:
tchar Template: type of string we're working with
p1 first string
p2 next string
Returns:
>0 if p1<p2, <0 if p1>p2, 0 if p1==p2

Definition at line 534 of file gstring.h.

#define ctl_gstring_remain ( tchar,
self   )     ( (self)->endBuff - (self)->end )

Tell how much bigger the string can get before it reallocates.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Count of characters that remain to be parsed

Definition at line 123 of file gstring.h.

#define ctl_gstring_reset ( tchar,
self   )     { if( (self)->begin != ctl_mstring_(tchar,grow,0) ) { (self)->end = (self)->begin; *(self)->begin = 0; } }

Reset parse point to beginning.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Pointer to start of string

Definition at line 141 of file gstring.h.

Referenced by ctl_xmlread_getattribute(), ctl_xmlread_getcontent(), ctl_xmlread_getname(), ctl_xmlread_gettextafter(), ctl_xmlread_gettextbefore(), and wchar_t_xml_read_gstring().

#define ctl_gstring_resize ( tchar,
self,
count   )     { ctl_mstring_(tchar,grow, grow )( (self), (count) - ((self)->end-(self)->begin) ); *((self)->end = (self)->begin+(count)) = 0; }

Grow or shrink a string, in preparation for some external copy/operation.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
count Character count to grow to

Definition at line 168 of file gstring.h.

Referenced by char_record_read_gstring(), char_serial_read_gstring(), char_xml_read_gstring(), wchar_t_record_read_gstring(), and wchar_t_serial_read_gstring().

#define ctl_gstring_size ( tchar,
self   )     ((size_t)( (self)->end - (self)->begin ))

Tell how many characters are in the string, right now.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Characters in the whole set

Definition at line 132 of file gstring.h.

Referenced by char_record_size_gstring(), ctl_xmlread_string(), ctl_xmlwrite_string_char(), and wchar_t_record_size_gstring().

#define ctl_gstring_sprintf ( tchar,
selffmtargs   )     ctl_mstring_(tchar,grow, sprintf ) selffmtargs

Add/overwrite text at parse ala sprintf formatting arguments.

Parameters:
tchar Template: type of string we're working with
selffmtargs Wrap selffmtargs in their own parentheses to group them, then pass them in, like certain macro implementations of trace
ctl_gstring_sprintf(char,grow,("%d", iVal) );

Definition at line 497 of file gstring.h.

#define ctl_gstring_strcat ( tchar,
self,
sz   )     ctl_mstring_(tchar,grow, strncat )((self),(sz), ~0u )

Concatenate a string onto this at parse.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
sz String to concatenate

Definition at line 427 of file gstring.h.

Referenced by ctl_xmlwrite_string_char(), and ctl_xmlwrite_string_wchar_t().

#define ctl_gstring_strcpy ( tchar,
self,
sz   )     ctl_mstring_(tchar,grow, strncpy )((self),(sz), ~0u )

Copy another string on top of this, setting the parse point after sz.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
sz String to replace this with

Definition at line 436 of file gstring.h.

#define ctl_gstring_strinsert ( tchar,
self,
position,
sz   )     ctl_mstring_(tchar,grow, strninsert )((self),(position),(sz), 0u )

Insert a string at parse; anything between 'position' and 'parse' is maintained AFTER inserted string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
position Where to insert
sz String to replace this with

Definition at line 466 of file gstring.h.

#define ctl_gstring_strncat ( tchar,
self,
sz,
maxLen   )     ctl_mstring_(tchar,grow, strncat )((self),(sz),(maxLen) )

Concatenate a string onto this at parse.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
sz String to concatenate
maxLen Maximum count of characters to take from sz

Definition at line 446 of file gstring.h.

#define ctl_gstring_strncpy ( tchar,
self,
sz,
maxLen   )     ctl_mstring_(tchar,grow, strncpy )((self),(sz),(maxLen) )

Copy another string on top of this, setting the parse point and end after sz.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
sz String to replace this with
maxLen Maximum count of characters to take from sz

Definition at line 456 of file gstring.h.

Referenced by ctl_xmlread_string().

#define ctl_gstring_strninsert ( tchar,
self,
position,
sz,
maxLen   )     ctl_mstring_(tchar,grow, strninsert )((self),(position),(sz),(maxLen) )

Insert a string at parse; anything between 'position' and 'parse' is maintained AFTER inserted string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
position Where to insert
sz String to replace this with
maxLen Maximum count of characters to take from sz

Definition at line 477 of file gstring.h.

#define ctl_gstring_swap ( tchar,
p1,
p2   ) 

Value:

{\
        ctl_gstring(tchar) tmp = *(p1);\
        *(p1) = *(p2);\
        *(p2) = tmp;\
    }
Swap two fstrings -.

Parameters:
tchar Template: type of string we're working with
p1 String to end up with contents of p2
p2 String to end up with contents of p1

Definition at line 94 of file gstring.h.

#define ctl_gstring_truncate ( tchar,
self,
newsize   )     ctl_mstring_(tchar,grow, truncate )( (self), (newsize) )

Truncate a string's trailing characters.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
newsize Size string should be afterwards

Definition at line 514 of file gstring.h.

#define ctl_gstring_vsprintf ( tchar,
self,
fmt,
args   )     ctl_mstring_(tchar,grow, vsprintf )((self),(fmt),(args) )

Add/overwrite text at parse ala vsprintf formatting arguments.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
fmt Printf string format argument
args Arguments to the printf, ala stdarg.h

Definition at line 487 of file gstring.h.

#define ctl_mstring ( tchar,
handler   )     ppConcat4(ctl_mstring_,tchar,_,handler)

Get class name from base name and character type.

Parameters:
tchar Character type (char or wchar_t)
handler (fixed or grow)

Definition at line 31 of file mstring.h.

#define ctl_mstring_ ( tchar,
handler,
function   )     ppConcat3(ctl_mstring(tchar,handler),_,function)

Build the function name from character type and root class.

Parameters:
tchar Character type (char or wchar_t)
handler (fixed or grow)
function Function name to concatenate together

Definition at line 40 of file mstring.h.

#define ctl_sconst ( tchar   )     ppConcat(ctl_sconst_,tchar)

Get class name from base name and character type.

Parameters:
tchar Character type

Definition at line 24 of file cstring.h.

Referenced by char_xml_read_gstring(), char_xml_read_string(), ctl_xmlread_getattribute(), ctl_xmlread_getattribute_int(), raw_xml_readbytes(), wchar_t_xml_read_gstring(), and wchar_t_xml_read_string().

#define ctl_sconst_ ( tchar,
function   )     ppConcat3(ctl_sconst( tchar ),_,function)

Build the function name from character type and root class.

Parameters:
tchar Character type
function Function name to concatenate together

Definition at line 32 of file cstring.h.

#define ctl_sconst_auto ( tchar,
begin,
end,
label   )     ctl_sconst( tchar ) label = { (begin), (begin), (end) }

Make fixed string operator on stack or as a global, with begin/end pointers Uses non-standard ANSI extension: non-const initializers.

Parameters:
tchar Template: type of string we're working with
begin First valid character in string
end One place after the last valid character in the string, and not necessarily NUL
label What to call this instance

Definition at line 43 of file cstring.h.

#define ctl_sconst_auto_buff ( tchar,
buff,
len,
label   )     ctl_sconst( tchar ) label = { (buff), (buff), (buff)+cstrnlen(tchar)((buff),(len)) }

Make fixed string operator on stack or as a global, with buffer Uses non-standard ANSI extension: non-const initializers.

Parameters:
tchar Template: type of string we're working with
buff Const pointer to a buffer containing const string data
len size_t length of buff
label What to call this instance

Definition at line 66 of file cstring.h.

#define ctl_sconst_auto_mmap ( tchar,
mmap,
label   )     ctl_sconst( tchar ) label = { (const tchar*)ctl_mmap_ptr(mmap), (const tchar*)ctl_mmap_ptr(mmap), (const tchar*)ctl_mmap_ptr(mmap)+ctl_mmap_size(mmap) }

Make fixed string operator on stack or as a global, with buffer Uses non-standard ANSI extension: non-const initializers.

Parameters:
tchar Template: type of string we're working with
mmap A memory mapped file that's been loaded up
label What to call this instance

Definition at line 88 of file cstring.h.

#define ctl_sconst_auto_string ( tchar,
mstr,
label   )     ctl_sconst( tchar ) label = { (mstr)->begin, (mstr)->begin, (mstr)->end }

Make fixed string operator on stack or as a global, with buffer Uses non-standard ANSI extension: non-const initializers.

Parameters:
tchar Template: type of string we're working with
mstr Pointer to another compatible string with begin/end (gstring/fstring/cstring) to initialize from
label What to call this instance

Definition at line 54 of file cstring.h.

#define ctl_sconst_auto_sz ( tchar,
sz,
label   )     ctl_sconst( tchar ) label = { (sz), (sz), (sz)+cstrlen(tchar)((sz)) }

Make fixed string operator on stack or as a global, with buffer Uses non-standard ANSI extension: non-const initializers.

Parameters:
tchar Template: type of string we're working with
sz NUL terminated string pointer
label What to call this instance

Definition at line 77 of file cstring.h.

#define ctl_sconst_begin ( tchar,
self   )     ( (self)->begin )

Reset parse point to beginning.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Pointer to start of this string

Definition at line 255 of file cstring.h.

#define ctl_sconst_compare ( tchar,
p1,
p2   )     ctl_sconst_(tchar,compare)( (p1),(p2) )

Do a string comparison at parse point.

Parameters:
tchar Template: type of string we're working with
p1 First string to compare
p2 Second string to compare
Returns:
value of strcmp

Definition at line 622 of file cstring.h.

#define ctl_sconst_consumed ( tchar,
self   )     ( (self)->parse - (self)->begin )

Tell how many characters have been parsed.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Count of characters that have been parsed

Definition at line 219 of file cstring.h.

#define ctl_sconst_copy ( tchar,
self,
from   ) 

Value:

{\
    (self)->begin = (from)->begin;\
    (self)->parse = (from)->parse;\
    (self)->end = (from)->end;\
}
Copy from another ctlmfg_ctl_sconst.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
from Instance to copy

Definition at line 154 of file cstring.h.

#define ctl_sconst_dmatch ( tchar,
self,
substring,
chOpen,
chClose   )     ctl_sconst_(tchar,dmatch)( self, substring, chOpen, chClose )

Search for a block of text enclosed by two symbols, such as (), {} or [] The depth of opening types is matched to the depth of closing types.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
substring A ctl_sconst to receive the bounds of the discovered string
chOpen The opening character
chClose The closing character
Returns:
true if found, and self->parse points next character after close, false if not, and parse point unaffected

Definition at line 488 of file cstring.h.

#define ctl_sconst_dmatchstr ( tchar,
self,
substring,
szOpen,
szClose   )     ctl_sconst_(tchar,dmatchstr)( self, substring, szOpen, szClose )

Search for a block of text enclosed by two strings, such as "<",/>" "begin","end".

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
substring A ctl_sconst to receive the bounds of the discovered string
szOpen The opening string
szClose The closing string
Returns:
true if found, and self->parse points next character after close, false if not, and parse point unaffected

Definition at line 500 of file cstring.h.

#define ctl_sconst_end ( tchar,
self   )     ( (self)->end )

Reset parse point to beginning.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Pointer to end of this string (not necessarily NUL)

Definition at line 264 of file cstring.h.

#define ctl_sconst_findclass ( tchar,
self,
classname   )     ctl_sconst_(tchar,ppConcat(find_,classname))( self )

Find the next instance of a character class ala ctype.h.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
classname One of: isalnum, isalpha, iscntrl... or just see DEF_Supported_Class_Scans for a list of generated scans
Returns:
true if character was found, and parse points at it, false if it wasn't, and parse is unchanged

Definition at line 538 of file cstring.h.

#define ctl_sconst_findnotclass ( tchar,
self,
classname   )     ctl_sconst_(tchar,ppConcat(find_not_,classname))( self )

Find the next instance that is not of a character class ala ctype.h.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
classname One of: isalnum, isalpha, iscntrl... or just see DEF_Supported_Class_Scans for a list of generated scans
Returns:
true if character was found, and parse points at it, false if it wasn't, and parse is unchanged

Definition at line 548 of file cstring.h.

#define ctl_sconst_foreach ( tchar,
self,
iterator   ) 

Value:

const tchar* iterator = (self)->begin;\
    const tchar* ppConcat(end_,iterator) = (self)->end;\
    for( ; iterator < ppConcat(end_,iterator); ++iterator )
Iterate the characters in the string from beginning to end.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
iterator What to call the iterator

Definition at line 1005 of file cstring.h.

Referenced by wchar_t_xml_read_gstring(), and wchar_t_xml_read_string().

#define ctl_sconst_foreach_reverse ( tchar,
self,
iterator   ) 

Value:

const tchar* iterator = (self)->end;\
    const tchar* ppConcat(end_,iterator) = (self)->begin;\
    while( iterator-- < ppConcat(end_,iterator) )
Iterate the characters in the string from end to beginning.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on(like 'this' in C++)
iterator What to call the iterator

Definition at line 1017 of file cstring.h.

#define ctl_sconst_from_ctlfixed ( tchar,
self,
fixed   ) 

Value:

{\
    (self)->parse = (self)->begin = (fixed)->begin;\
    (self)->end = (fixed)->end;\
}
Reference a fixed C string for parsing.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
fixed Fixed (buffered) string we're referencing

Definition at line 183 of file cstring.h.

#define ctl_sconst_from_ctlstring ( tchar,
self,
variable   ) 

Value:

{\
    (self)->parse = (self)->begin = (variable)->begin;\
    (self)->end = (self)->begin + (variable)->(len);\
}
Reference a fixed C string for parsing.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
variable Variable length string we're referencing (This may become invalid if variable string is changed!)

Definition at line 197 of file cstring.h.

#define ctl_sconst_getbool ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getbool)( self, pValue )

Decode a boolean; any decimal number, true/on, false/off will do.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if string was recognizable as a true/false sort of thing, false if it wasn't (and pValue will be set to false)

Definition at line 652 of file cstring.h.

#define ctl_sconst_getenum ( tchar,
self,
pValue,
szz   )     ctl_sconst_(tchar,getenum)( self, pValue, szz )

Decode one of a set of possible strings to an index into that set.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to integer to receive the value
szz A NULL terminated array of string pointers to match against
Returns:
true if value was definitely determined; false if not, and *value == -1 On success, parse point is next character after value

Definition at line 879 of file cstring.h.

#define ctl_sconst_getfloat32 ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getfloat32)( self, pValue )

Decode a value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 742 of file cstring.h.

#define ctl_sconst_getfloat64 ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getfloat64)( self, pValue )

Decode a value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0 On success, parse point is next character after value

Definition at line 753 of file cstring.h.

#define ctl_sconst_getienum ( tchar,
self,
pValue,
szz   )     ctl_sconst_(tchar,getienum)( self, pValue, szz )

Decode one of a set of possible strings to an index into that set, case insensitive.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to integer to receive the value
szz A NULL terminated array of string pointers to match against
Returns:
true if value was definitely determined; false if not, and *value == -1 On success, parse point is next character after value

Definition at line 891 of file cstring.h.

#define ctl_sconst_getint16 ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getint16)( self, pValue )

Decode a value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 682 of file cstring.h.

#define ctl_sconst_getint32 ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getint32)( self, pValue )

Decode a value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 702 of file cstring.h.

Referenced by ctl_xmlread_getattribute_int().

#define ctl_sconst_getint64 ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getint64)( self, pValue )

Decode a value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 722 of file cstring.h.

#define ctl_sconst_getint8 ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getint8)( self, pValue )

Decode a value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 662 of file cstring.h.

#define ctl_sconst_getuint16 ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getuint16)( self, pValue )

Decode a value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 692 of file cstring.h.

#define ctl_sconst_getuint32 ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getuint32)( self, pValue )

Decode a value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 712 of file cstring.h.

#define ctl_sconst_getuint64 ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getuint64)( self, pValue )

Decode a value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 732 of file cstring.h.

#define ctl_sconst_getuint8 ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getuint8)( self, pValue )

Decode a value.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 672 of file cstring.h.

#define ctl_sconst_getxbool ( tchar,
self,
pValue   )     ctl_sconst_(tchar,getbool)( self, pValue )

Decode an 8 bit hexadecimal value, stopping at 2 digits.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 763 of file cstring.h.

#define ctl_sconst_getxint16 ( tchar,
self,
pValue   )     ctl_sconst_(tchar, getxint16 )( self, pValue )

Decode a 16 bit hexadecimal value, stopping at 4 digits.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 793 of file cstring.h.

#define ctl_sconst_getxint32 ( tchar,
self,
pValue   )     ctl_sconst_(tchar, getxuint32 )( self, (uint32*)(pValue), 8 )

Decode a 32 bit hexadecimal value, stopping at 8 digits.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 813 of file cstring.h.

#define ctl_sconst_getxint64 ( tchar,
self,
pValue   )     ctl_sconst_(tchar, getxuint64 )( self, (uint64*)(pValue), 16 )

Decode a 64 bit hexadecimal value, stopping at 16 digits.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 833 of file cstring.h.

#define ctl_sconst_getxint8 ( tchar,
self,
pValue   )     ctl_sconst_(tchar, getxint8 )( self, pValue )

Decode an 8 bit hexadecimal value, stopping at 2 digits.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 773 of file cstring.h.

#define ctl_sconst_getxn ( tchar,
self,
pValue,
numDigits   )     ctl_sconst_(tchar, getx64 )( self, pValue, numDigits )

Decode a hexadecimal value up to 32 bits (8 digits), limiting to some arbitrary number of places of precision Useful for places where we simply append hexadecimal data together at fixed widths.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to uint32 variable to receive value
numDigits Number of digits to stop after; i.e. 4 if you only want 16 bits
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 855 of file cstring.h.

#define ctl_sconst_getxnn ( tchar,
self,
pValue,
numDigits   )     ctl_sconst_(tchar, getx64 )( self, pValue, numDigits )

Decode a hexadecimal value up to 64 bits (16 digits), limiting to some arbitrary number of places of precision Useful for places where we simply append hexadecimal data together at fixed widths.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to uint64 variable to receive value
numDigits Number of digits to stop after; i.e. 4 if you only want 16 bits
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 867 of file cstring.h.

#define ctl_sconst_getxuint16 ( tchar,
self,
pValue   )     ctl_sconst_(tchar, getxuint16 )( self, pValue )

Decode a 16 bit hexadecimal value, stopping at 4 digits.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 803 of file cstring.h.

#define ctl_sconst_getxuint32 ( tchar,
self,
pValue   )     ctl_sconst_(tchar, getxuint32 )( self, pValue, 8 )

Decode a 32 bit hexadecimal value, stopping at 8 digits.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 823 of file cstring.h.

#define ctl_sconst_getxuint64 ( tchar,
self,
pValue   )     ctl_sconst_(tchar, getxuint64 )( self, pValue, 16 )

Decode a 64 bit hexadecimal value, stopping at 16 digits.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 843 of file cstring.h.

#define ctl_sconst_getxuint8 ( tchar,
self,
pValue   )     ctl_sconst_(tchar, getxuint8 )( self, pValue )

Decode an 8 bit hexadecimal value, stopping at 2 digits.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pValue Pointer to variable to receive value
Returns:
true if value was definitely determined; false if not, and *value == 0

Definition at line 783 of file cstring.h.

Referenced by raw_xml_readbytes().

#define ctl_sconst_icompare ( tchar,
self,
other   )     ctl_sconst_(tchar,icompare)( (self), (other) )

Do a case insensitive string comparison at parse point.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
other Other ctl_sconst type to compare against
Returns:
value of stricmp

Definition at line 642 of file cstring.h.

#define ctl_sconst_init ( tchar,
self,
buff,
len   ) 

Value:

{\
    (self)->parse = (self)->begin = (buff);\
    (self)->end = (self)->begin + cstrnlen(tchar)((buff),(len));\
}
Initialize from a pointer and length.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
buff Pointer to a string buffer
len size_t length of buff

Definition at line 99 of file cstring.h.

#define ctl_sconst_init_mmap ( tchar,
self,
mmap   ) 

Value:

{\
    (self)->parse = (self)->begin = (const tchar*)ctl_mmap_ptr(mmap);\
    (self)->end = (self)->begin + ctl_mmap_size(mmap);\
}
Initialize from a NUL terminated string pointer.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
mmap Pointer to a memory mapped file that's been loaded up

Definition at line 125 of file cstring.h.

#define ctl_sconst_init_pointers ( tchar,
self,
pBegin,
pEnd   ) 

Value:

{\
    (self)->parse = (self)->begin = (pBegin);\
    (self)->end = (pEnd);\
    assert( (self)->end >= (self)->begin );\
}
Initialize from a pointer and length.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
pBegin Start pointer
pEnd End pointer

Definition at line 169 of file cstring.h.

Referenced by char_serial_peek_sconst(), char_serial_read_sconst(), wchar_t_serial_peek_sconst(), and wchar_t_serial_read_sconst().

#define ctl_sconst_init_sz ( tchar,
self,
sz   ) 

Value:

{\
    (self)->parse = (self)->begin = (sz);\
    (self)->end = (self)->begin + cstrlen(tchar)(sz);\
}
Initialize from a NUL terminated string pointer.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
sz Pointer to a string

Definition at line 112 of file cstring.h.

#define ctl_sconst_isalnum ( tchar,
self   )     ( cisalnum(tchar)(*(self)->parse) )

C runtime clone of isalnum.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if character at parse position is if A-Z,a-z,0-9

Definition at line 291 of file cstring.h.

#define ctl_sconst_isalpha ( tchar,
self   )     ( cisalpha(tchar)(*(self)->parse) )

C runtime clone of isalpha.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if character at parse position is A-Z,a-z

Definition at line 300 of file cstring.h.

#define ctl_sconst_iscntrl ( tchar,
self   )     ( ciscntrl(tchar)(*(self)->parse) )

C runtime clone of iscntrl.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if character at parse position is <0x20

Definition at line 309 of file cstring.h.

#define ctl_sconst_isdigit ( tchar,
self   )     ( cisdigit(tchar)(*(self)->parse) )

C runtime clone of isdigit.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if character at parse position is 0-9

Definition at line 318 of file cstring.h.

#define ctl_sconst_isgraph ( tchar,
self   )     ( cisgraph(tchar)(*(self)->parse) )

C runtime clone of isgraph.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if character is not white space

Definition at line 327 of file cstring.h.

#define ctl_sconst_islower ( tchar,
self   )     ( cislower(tchar)(*(self)->parse) )

C runtime clone of islower.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if character is a-z

Definition at line 336 of file cstring.h.

#define ctl_sconst_isprint ( tchar,
self   )     ( cisprint(tchar)(*(self)->parse) )

C runtime clone of isprint.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if character is printable

Definition at line 372 of file cstring.h.

#define ctl_sconst_ispunct ( tchar,
self   )     ( cispunct(tchar)(*(self)->parse) )

C runtime clone of ispunct.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if character is a punctuation mark

Definition at line 345 of file cstring.h.

#define ctl_sconst_isspace ( tchar,
self   )     ( cisspace(tchar)(*(self)->parse) )

C runtime clone of isspace.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if character is white space

Definition at line 354 of file cstring.h.

#define ctl_sconst_isupper ( tchar,
self   )     ( cisupper(tchar)(*(self)->parse) )

C runtime clone of isupper.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if character is A-Z

Definition at line 363 of file cstring.h.

#define ctl_sconst_isxdigit ( tchar,
self   )     ( cisxdigit(tchar)(*(self)->parse) )

C runtime clone of isxdigit.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if character is 0-9,A-F,a-f

Definition at line 381 of file cstring.h.

#define ctl_sconst_left ( tchar,
self,
cstr_left,
count   ) 

Value:

{\
    (cstr_left)->begin = (cstr_left)->parse = (self)->(begin);\
    (cstr_left)->end = (cstr_left)->begin + (count);\
    if( (cstr_left)->end > (self)->end )\
        (cstr_left)->end = (self)->end;\
}
A bit like left$ in BASIC, except it produces a const substring.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
cstr_left Substring to receive pointers
count Number of characters from left end of 'self' to initialize 'left' with

Definition at line 391 of file cstring.h.

#define ctl_sconst_mid ( tchar,
self,
cstr_mid,
offset,
count   ) 

Value:

{\
    (cstr_mid)->begin = (cstr_mid)->parse = (self)->begin + (offset);\
    (cstr_mid)->end = (cstr_mid)->begin + (count);\
    if( (cstr_mid)->begin > (self)->end )\
    {\
        (cstr_mid)->begin = (self)->end;\
        (cstr_mid)->end = (self)->end;\
    }\
    if( (cstr_mid)->end > (self)->end )\
        (cstr_mid)->end = (self)->end;\
}
A bit like mid$ in BASIC, except it produces a const substring.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
cstr_mid Substring to receive pointers
offset 0 based start index of data
count Number of characters from left end of 'self' to initialize 'left' with

Definition at line 424 of file cstring.h.

#define ctl_sconst_next ( tchar,
self   )     ( (self)->parse < (self)->end ? (++(self)->parse) : (self)->end )

Parse to next character in const string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Next character, or pointer to end

Definition at line 273 of file cstring.h.

#define ctl_sconst_nextspace ( tchar,
self   )     ctl_sconst_(tchar,nextspace)( self )

Skip over any NON-white space until we find a space.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if non-white space found, and parse point points to it, false if not, and parse point unaffected

Definition at line 528 of file cstring.h.

#define ctl_sconst_parse ( tchar,
self   )     ( (self)->parse )

Get current parse position.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Pointer into this string where next operation will happen

Definition at line 237 of file cstring.h.

#define ctl_sconst_prev ( tchar,
self   )     ( (self)->parse > (self)->begin ? (--(self)->parse) : (self)->begin )

Parse to previous character in const string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Previous character, or pointer to begin

Definition at line 282 of file cstring.h.

#define ctl_sconst_printf_arg ( self   )     ((self)->end - (self)->begin), (self)->begin

Printf arguments for ctl_sconst_printf_fmt.

Parameters:
self Instance of string we're operating on (like 'this' in C++) Example: printf( szconst(char,"Hello ") ctl_sconst_printf_fmt(char) szconst(char,"!\n"), ctl_sconst_printf_arg(str) );

Definition at line 145 of file cstring.h.

#define ctl_sconst_printf_fmt ( tchar   )     szconst(tchar,"%.*s")

Printf format string for ctl_sconst_printf_arg.

Parameters:
tchar Template: type of string we're working with Example: printf( szconst(char,"Hello ") ctl_sconst_printf_fmt(char) szconst(char,"!\n"), ctl_sconst_printf_arg(str) );

Definition at line 137 of file cstring.h.

#define ctl_sconst_rcompare ( tchar,
p1,
p2   )     ctl_sconst_(tchar,compare)( (p2),(p1) )

Do a string reverse comparison at parse point.

Parameters:
tchar Template: type of string we're working with
p1 First string to compare
p2 Second string to compare
Returns:
value of strcmp

Definition at line 632 of file cstring.h.

#define ctl_sconst_remain ( tchar,
self   )     ( (self)->end - (self)->parse )

Tell how many characters remain to be parsed.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Count of characters that remain to be parsed

Definition at line 210 of file cstring.h.

#define ctl_sconst_reset ( tchar,
self   )     ( (self)->parse = (self)->begin )

Reset parse point to beginning.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Pointer to start of string

Definition at line 246 of file cstring.h.

#define ctl_sconst_right ( tchar,
self,
cstr_right,
count   ) 

Value:

{\
    (cstr_right)->begin = (cstr_right)->parse = (self)->(end)-(count);\
    (cstr_right)->end = (self)->end;\
    if( (cstr_right)->begin < (self)->begin )\
        (cstr_right)->begin = (self)->begin;\
}
A bit like right$ in BASIC, except it produces a const substring.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
cstr_right Substring to receive pointers
count Number of characters from left end of 'self' to initialize 'left' with

Definition at line 407 of file cstring.h.

#define ctl_sconst_scanclass ( tchar,
self,
found,
classname   )     ctl_sconst_(tchar,ppConcat(scan_,classname))( self, found )

Scan for a block of characters that are of a class type.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
found If the character class was found, this cstring points to the first and ends with the first NOT (or (self)->end)
classname One of: isalnum, isalpha, iscntrl... or just see DEF_Supported_Class_Scans for a list of generated scans
Returns:
true if character set was found, and self's parse point is left pointing after it

Definition at line 559 of file cstring.h.

#define ctl_sconst_scannotclass ( tchar,
self,
found,
classname   )     ctl_sconst_(tchar,ppConcat(scan_not_,classname))( self, found )

Scan for a block of characters that are NOT of a class type.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
found If the non-character class was found, this cstring points to the first and ends with the first NOT (or (self)->end)
classname One of: isalnum, isalpha, iscntrl... or just see DEF_Supported_Class_Scans for a list of generated scans
Returns:
true if non-character set was found, and self's parse point is left pointing after it

Definition at line 570 of file cstring.h.

#define ctl_sconst_size ( tchar,
self   )     ((size_t)( (self)->end - (self)->begin ))

Tell how many characters are in the string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
Characters in the whole set

Definition at line 228 of file cstring.h.

Referenced by char_xml_read_gstring(), and char_xml_read_string().

#define ctl_sconst_skipspace ( tchar,
self   )     ctl_sconst_(tchar,skipspace)( self )

Skip over any white space.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
Returns:
true if non-white space found, and parse point points to it, false if not, and parse point unaffected

Definition at line 519 of file cstring.h.

#define ctl_sconst_strchr ( tchar,
self,
ch   )     ctl_sconst_(tchar,strchr)( self, ch )

Look for a character in a string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
ch What character we're seeking
Returns:
true if found, and self->parse points to string, false if not, and parse point unaffected

Definition at line 445 of file cstring.h.

#define ctl_sconst_strcmp ( tchar,
self,
sz   )     ctl_sconst_(tchar,strcmp)( self, sz )

Do a string comparison at parse point.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
sz String to compare with
Returns:
value of strcmp

Definition at line 580 of file cstring.h.

#define ctl_sconst_strichr ( tchar,
self,
ch   )     ctl_sconst_(tchar,strichr)( self, ch )

Look for a character in a string; case insensitive.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
ch What character we're seeking
Returns:
true if found, and self->parse points to string, false if not, and parse point unaffected

Definition at line 455 of file cstring.h.

#define ctl_sconst_stricmp ( tchar,
self,
sz   )     ctl_sconst_(tchar,stricmp)( self, sz )

Do a case insensitive string comparison at parse point.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
sz String to compare with
Returns:
value of stricmp

Definition at line 590 of file cstring.h.

#define ctl_sconst_stristr ( tchar,
self,
sz   )     ctl_sconst_(tchar,stristr)( self, sz )

Look for a string in a string; case insensitive.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
sz String we're seeking
Returns:
true if found, and self->parse points to string, false if not, and parse point unaffected

Definition at line 475 of file cstring.h.

#define ctl_sconst_strncmp ( tchar,
self,
sz,
count   )     ctl_sconst_(tchar,strncmp)( self, sz, count )

Do a string comparison at parse point.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
sz String to compare with
count Maximum length of compare
Returns:
value of strcmp

Definition at line 601 of file cstring.h.

#define ctl_sconst_strnicmp ( tchar,
self,
sz,
count   )     ctl_sconst_(tchar,strnicmp)( self, sz, count )

Do a case insensitive string comparison at parse point.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
sz String to compare with
count Maximum length of compare
Returns:
value of stricmp

Definition at line 612 of file cstring.h.

#define ctl_sconst_strpbrk ( tchar,
self,
szSet   )     ctl_sconst_(tchar,strpbrk)( self, szSet )

Look for any one of the characters in szSet in this string starting at parse point.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
szSet String containing characters to look for
Returns:
true if found, and parse point points to it, false if not, and parse point unaffected

Definition at line 510 of file cstring.h.

#define ctl_sconst_strstr ( tchar,
self,
sz   )     ctl_sconst_(tchar,strstr)( self, sz )

Look for a string in a string.

Parameters:
tchar Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
sz String we're seeking
Returns:
true if found, and self->parse points to string, false if not, and parse point unaffected

Definition at line 465 of file cstring.h.

#define ctldecl_ctl_mstring ( tchar,
handler   ) 

Base class for ctl_fstring and ctl_string.

Parameters:
tchar Character type
handler Template: Handler for when added text will exceed current size: fixed or grow.
Basically the generator takes one of two (or more) name stubs to handle either receiving a fixed buffer in memory and stopping formatting at its end, or allocating data through some method (like ctl/ctlnew.h) to grow the memory when it needs to get bigger.

This means that the code in all modifying cases will depend on knowing how bit the data will be, when appended, deciding (based on template) to grow or fixed, then performing the operation if it can.

The fixed string method is safe, but if you exceed your predicted requirements, your final string will be truncated.

The grow string method is also safe, and will make strings bigger as data is added to them, but you must *remember to destroy the string* Keep in mind that memory allocation is not free, and that in a busy heap, many cycles can be lost searching for free space to store a string that could've been written into a stack based buffer. Especially if you are leaking strings.

Definition at line 84 of file mstring.h.

#define ctldecl_ctl_sconst ( tchar   ) 

Declare a constant string parser class of functionality.

Parameters:
tchar Character type
This basically is a substring parser: it never, ever assumes the strings it is operating on are NUL terminated. It simply keeps track of the end of the string with a pointer. So, you can cut a ctlConstString into pieces for other ctlConstString based code to operate on by setting some pointers, rather than making copies of data.

This is many orders of magnitude faster than conventional string parsing with allocated 'smart' strings.

What it also means is the underlying string should not be changed while an instance of substring is operating on it - it's literally pointing right at the data, and if it's reallocated, freed or modified, it could be pointing at invalid data, or heap space that isn't even valid for reading.

Definition at line 915 of file cstring.h.

#define DEF_Supported_Class_Scans ( tchar,
def   ) 

Value:

def( tchar, isalnum )\
    def( tchar, isalpha )\
    def( tchar, iscntrl )\
    def( tchar, isdigit )\
    def( tchar, isgraph )\
    def( tchar, islower )\
    def( tchar, ispunct )\
    def( tchar, isspace )\
    def( tchar, isupper )\
    def( tchar, isprint )\
    def( tchar, isxdigit )
This is the generator template list for scanning for character types ala ctype.h; add your custom handlers here to extend it, if you like.

Parameters:
tchar Character class template passed through to generators
def Filter to generate definitions based on this list

Definition at line 969 of file cstring.h.

#define ppCtypeSelect ( tchar,
xchar,
xwchar_t   )     ppConcat(_ppCtypeSelect_,tchar)(xchar,xwchar_t)

Make selection logic for character type handler a little more compact.

Parameters:
tchar Kind of char we want
xchar This is extracted into the preprocessor output if 'tchar' is 'char'
xwchar_t This is extracted into the preprocessor output if 'tchar' is 'wchar_t'

Definition at line 146 of file ctlstring.h.

#define szconst ( tchar,
sz   )     ppConcat(szconst_,tchar)(sz)

#define szconvert ( tchardst,
tcharsrc   )     (ch) ppConcat3(szconvert_,tchardst,tcharsrc)

Convert from wchar_t<->char.

Parameters:
tcharsrc Type of character ch is
tchardst Type of character ch should become
Returns:
tchardst sort of copy of ch

Definition at line 50 of file ctlstring.h.

#define szstrfmt ( tchar   )     ppConcat(szstrfmt_,tchar)

The 'standard' format is for ls when receiving wchar_t strings, and s when receiving char strings.

Parameters:
tchar Type of character printf is for
Returns:
printf format for type of string to pass to cprintf(tchar)

Definition at line 62 of file ctlstring.h.


Function Documentation

ctl_mstring_xgrow ( tchar  ,
handler  ,
const tchar   ctl_mstring_(tchar, handler, 0)[1] = szconst(tchar,""); 
)

See if the string needs to grow, grow it according to templats
(tchar,handler) Template: type of string we're working with
self Instance of string we're operating on (like 'this' in C++)
addLen How much to grow by
.

Manufacture modifiable string functions based on template parameters tchar Character type handler Template: Handler for when added text will exceed current size: fixed or grow.

bool ctl_sconst_ ( tchar  ,
strchr   
)

Look for a character in a string tchar Template: type of string we're working with self Instance of string we're operating on (like 'this' in C++) ch What character we're seeking.

Returns:
true if found, and self->parse points to string, false if not, and parse point unaffected

bool wchar_t ppConcat ( ctl_sconst_  ,
wchar_t   
) [read]

Constant substring parser class\.

\

Definition at line 996 of file cstring.h.

00998 : type of string we're working with

bool char ppConcat ( ctl_sconst_  ,
char   
) [read]

Constant substring parser class\.

\

Definition at line 992 of file cstring.h.

00998 : type of string we're working with

int fixed const ppConcat4 ( ctl_mstring_  ,
wchar_t  ,
,
fixed   
) [read]

Mutable string class.

\

Definition at line 137 of file mstring.h.

int fixed const ppConcat4 ( ctl_mstring_  ,
char  ,
,
fixed   
) [read]

Mutable string class.

\

Definition at line 133 of file mstring.h.

int grow const ppConcat4 ( ctl_mstring_  ,
wchar_t  ,
,
grow   
) [read]

Mutable string class.

\

Definition at line 127 of file mstring.h.

int grow const ppConcat4 ( ctl_mstring_  ,
char  ,
,
grow   
) [read]

Mutable string class.

\

Definition at line 123 of file mstring.h.


Generated on Fri Jan 2 15:28:36 2009 for Squat by  doxygen 1.5.6