Go to the source code of this file.
|
| #define | DECLARE_STATIC_STRING_COPY(copyName, copySrc) |
| | Declares and lazily intializes a buffer and copies src string into it, call at start of function passing in an arg so that you can tokenize the string with minimal dynamic memory allocation. uses a vector, but doesn't set the vectors size property, just uses it as a string buffer.
|
| |
|
| int | Str_Tokenize (char *string, char sep) |
| | replaces occurences of the char "sep" in the string with null characters and returns the resulting number of strings.
|
| |
| void | Str_AdvanceToNextToken (char **pNextToken) |
| | advance a char pointer to the null terminator and then past its
|
| |
◆ DECLARE_STATIC_STRING_COPY
| #define DECLARE_STATIC_STRING_COPY |
( |
|
copyName, |
|
|
|
copySrc |
|
) |
| |
Value: static VECTOR(
char) copyName = NULL; \
if(!copyName) \
{ \
} \
size_t len = strlen(copySrc); \
{ \
} \
strcpy(copyName, copySrc);
void * VectorResize(void *vector, unsigned int size)
Definition DynArray.c:16
#define VectorCapacity(vector)
Definition DynArray.h:31
#define NEW_VECTOR(a)
Definition DynArray.h:34
#define VECTOR(a)
Definition WfGame.h:8
Declares and lazily intializes a buffer and copies src string into it, call at start of function passing in an arg so that you can tokenize the string with minimal dynamic memory allocation. uses a vector, but doesn't set the vectors size property, just uses it as a string buffer.
- Parameters
-
| copyName | name of string copy variable |
| copySrc | source string |
◆ Str_AdvanceToNextToken()
| void Str_AdvanceToNextToken |
( |
char ** |
pNextToken | ) |
|
advance a char pointer to the null terminator and then past its
- Parameters
-
◆ Str_Tokenize()
| int Str_Tokenize |
( |
char * |
string, |
|
|
char |
sep |
|
) |
| |
replaces occurences of the char "sep" in the string with null characters and returns the resulting number of strings.
- Parameters
-
- Returns
- number of tokens