mstring.temp.h File Reference

Mutable string class generator template implementation. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ctl_mstring_growcode(tchar, handler, self, addLen)   ppConcat3(ctl_mstring_,handler,_growcode)(tchar, self, addLen )
#define ctl_mstring_check(tchar, handler, self, addLen)   ppConcat3(ctl_mstring_,handler,_check)(tchar, self, addLen )
#define ctl_mstring_checkabort(tchar, handler, self, addLen)   ppConcat3(ctl_mstring_,handler,_checkabort)(tchar, self, addLen )
#define ctl_mstring_grow_growcode(tchar, self, addLen)
#define ctl_mstring_fixed_growcode(tchar, self, addLen)   {}
#define ctl_mstring_fixed_check(tchar, self, addLen)
#define ctl_mstring_fixed_checkabort(tchar, self, addLen)

Functions

 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.


Detailed Description

Mutable string class generator template implementation.

Author:
David Mace mstring.h Contains the header that these reference mstring.temp.h Contains the template definitions mstring.c contains the template expansions fstring.h contains the "friendly" fixed string variants gstring.h contains the "friendly" grown string variants

Definition in file mstring.temp.h.


Define Documentation

#define ctl_mstring_check ( tchar,
handler,
self,
addLen   )     ppConcat3(ctl_mstring_,handler,_check)(tchar, self, addLen )

Extra check/grow steps - fixed if there isn't space

Definition at line 26 of file mstring.temp.h.

#define ctl_mstring_checkabort ( tchar,
handler,
self,
addLen   )     ppConcat3(ctl_mstring_,handler,_checkabort)(tchar, self, addLen )

Extra check/grow steps - fixed if there isn't space

Definition at line 28 of file mstring.temp.h.

#define ctl_mstring_fixed_check ( tchar,
self,
addLen   ) 

Value:

{ \
    assertobjptr(self);\
    if( (size_t)(addLen) > (size_t)((self)->endBuff-(self)->end) ) \
        (addLen) = (size_t)((self)->endBuff-(self)->end); \
    if( !(addLen) ) \
    {\
        *(self)->endBuff = 0;\
        return; \
    }\
}
In this version, we truncate a proposed addition to fit

Definition at line 58 of file mstring.temp.h.

#define ctl_mstring_fixed_checkabort ( tchar,
self,
addLen   ) 

Value:

{ \
    assertobjptr(self);\
    if( (size_t)(addLen) > (size_t)((self)->endBuff-(self)->end) ) \
    {\
        *(self)->endBuff = 0;\
        return; \
    }\
}
In this version, we fixed if a proposed addition will not fit

Definition at line 71 of file mstring.temp.h.

#define ctl_mstring_fixed_growcode ( tchar,
self,
addLen   )     {}

In this version, we make an empty function body

Definition at line 55 of file mstring.temp.h.

#define ctl_mstring_grow_growcode ( tchar,
self,
addLen   ) 

Value:

{ \
    tchar* begin; \
    size_t need; \
    assertobjptr(self);\
    begin = (self)->begin; \
    need = ((self)->end+(addLen)+1-begin); \
    if( need > (size_t)((self)->endBuff - (self)->begin) ) \
    {\
        need += ctl_mstring_delta;\
        if( (self)->begin == ctl_mstring_(tchar,handler,0) )\
            (self)->begin = NULL;\
        ctl_realloc((self)->begin,ctl_chsize(tchar,need)); \
        (self)->end = (self)->begin + ((self)->end - begin);\
        *(self)->end = 0;\
        (self)->endBuff = (self)->begin + need-1;\
    }\
}
Grow the string to fit, if the proposed addition is too big to fit already

Definition at line 32 of file mstring.temp.h.

#define ctl_mstring_growcode ( tchar,
handler,
self,
addLen   )     ppConcat3(ctl_mstring_,handler,_growcode)(tchar, self, addLen )

Extra check/grow steps - fixed if there isn't space

Definition at line 24 of file mstring.temp.h.


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