File StardewString.h

File List > engine > include > StardewString.h

Go to the documentation of this file

#ifndef STARDEWSTRING_H
#define STARDEWSTRING_H

#include "DynArray.h"

int Str_Tokenize(char* string, char sep);

void Str_AdvanceToNextToken(char** pNextToken);

#define DECLARE_STATIC_STRING_COPY(copyName, copySrc) \
    static VECTOR(char) copyName = NULL; \
    if(!copyName) \
    { \
        copyName = NEW_VECTOR(char); \
        copyName = VectorResize(copyName, 32000); \
    } \
    size_t len = strlen(copySrc); \
    while(len > VectorCapacity(copyName)) \
    { \
        copyName = VectorResize(copyName, VectorCapacity(copyName) * 2); \
    } \
    strcpy(copyName, copySrc); 

#endif