#ifndef _STRINGS_
#define _STRINGS_ 
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include "memory.h"
#include "list.h"
typedef struct STRBUF_HELP {
  MEMORY mem;
  size_t cap;
  size_t len;
  char *data;
} STRBUF_NODE, *STRBUF;
#ifdef __cplusplus
#define BEGIN_DECLS extern "C" {
#define END_DECLS }
#else
#define BEGIN_DECLS 
#define END_DECLS 
#endif
BEGIN_DECLS
BOOL string_Equal(const char*, const char*);
BOOL string_IsPrefix(const char *Pre, const char *Str);
int string_Length(const char*);
BOOL string_StringIsNumber(const char*);
BOOL string_StringIsInteger(const char*);
BOOL string_StringIsNatural(const char*);
char* string_Append(MEMORY mem, char* str1, const char* str2);
void string_AppendChar(char *str, const char c);
char* string_SubString(MEMORY, const char* str, size_t, size_t);
int string_SubStringChar(const char*, char, char, char*);
char* string_IntToString(MEMORY mem, int);
BOOL string_StringToInt(const char*, BOOL, int*);
BOOL string_StringToLong(const char*, BOOL, uint64_t*);
char* string_Conc(MEMORY mem, const char*, const char*);
char* string_Nconc(MEMORY mem, char*, char*);
char* string_EmptyString(MEMORY mem);
char* string_Prefix(MEMORY mem, const char*, int);
char* string_Suffix(MEMORY mem, const char*, size_t);
int string_Find(const char* str, const char* delims);
LIST string_Split(MEMORY mem, char*, const char*);
char** string_Tokens(MEMORY mem, char*, uintptr_t*);
const char* string_GetPostfix(const char* str, const char delim);
char* string_StringCopy(MEMORY mem, const char* String);
void string_StringFree(MEMORY, char*);
MEMORY string_GetMemory(STRBUF);
size_t string_GetLen(STRBUF);
void string_SetLen(STRBUF, size_t);
size_t string_GetCap(STRBUF);
void string_SetCap(STRBUF, size_t);
void string_SetChar(STRBUF, size_t, char);
const char* string_GetStr(STRBUF);
char* string_CopyStr(STRBUF);
char* string_GetData(STRBUF);
void string_SetData(STRBUF, char*);
STRBUF string_Init(MEMORY);
STRBUF string_InitWithCapacity(MEMORY, size_t Capacity);
void string_Clear(STRBUF);
void string_Free(STRBUF);
void string_Reserve(STRBUF, size_t CapacityOfAtLeast);
void string_ReserveExtra(STRBUF, size_t ExtraCapacity);
void string_AddStrN(STRBUF, const char*, size_t);
void string_AddStr(STRBUF, const char*);
void string_AddCharUnsafe(STRBUF, char);
void string_AddChar(STRBUF, char);
void string_AddNat(STRBUF, unsigned long long);
void string_AddInt(STRBUF, long long);
const char* string_VPrintf(STRBUF, const char *Format, va_list Args);
const char* string_Printf(STRBUF, const char *Format, ...);
char* string_VPrintfTempBuffer(MEMORY Mem, const char* Format, va_list Args);
char* string_PrintfTempBuffer(MEMORY Mem, const char* Format, ...);
void string_Test(MEMORY);
END_DECLS
#endif
