CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
strmanip.h
1#pragma once
2
4#include <cx/string/strbase.h>
5
6CX_C_BEGIN
7
9enum STRING_SPECIAL {
10 strEnd = 0x7fffffff
11};
12
58
78bool strAppend(_Inout_ strhandle io, _In_opt_ strref s);
79
96bool strPrepend(_In_opt_ strref s, _Inout_ strhandle io);
97
117bool strConcat(_Inout_ strhandle o, _In_opt_ strref s1, _In_opt_ strref s2);
118
139bool strConcatC(_Inout_ strhandle o, _Inout_ strhandle sc1, _Inout_ strhandle sc2);
140
161#define strNConcat(o, ...) _strNConcat(o, count_macro_args(__VA_ARGS__), (strref[]) { __VA_ARGS__ })
162bool _strNConcat(_Inout_ strhandle o, int n, _In_ strref* _Nonnull stra);
163
188#define strNConcatC(o, ...) \
189 _strNConcatC(o, count_macro_args(__VA_ARGS__), (string*[]) { __VA_ARGS__ })
190bool _strNConcatC(_Inout_ strhandle o, int n, _Inout_ strhandle* _Nonnull stra);
191
214bool strSubStr(_Inout_ strhandle o, _In_opt_ strref s, int32 b, int32 e);
215
235bool strSubStrC(_Inout_ strhandle o, _Inout_ strhandle sc, int32 b, int32 e);
236
254bool strSubStrI(_Inout_ strhandle io, int32 b, int32 e);
255
273void strUpper(_Inout_ strhandle io);
274
292void strLower(_Inout_ strhandle io);
293
318int32 strSplit(_Inout_ sa_string* _Nonnull out, _In_opt_ strref s, _In_opt_ strref sep, bool empty);
319
342bool strJoin(_Inout_ strhandle out, _In_ sa_string arr, _In_opt_ strref sep);
343
361uint8 strGetChar(_In_opt_ strref str, int32 i);
362
386void strSetChar(_Inout_ strhandle str, int32 i, uint8 ch);
387
389
390CX_C_END
string * strhandle
Pointer to a string variable.
Definition strbase.h:45
bool strAppend(strhandle io, strref s)
uint8 strGetChar(strref str, int32 i)
bool strSubStrI(strhandle io, int32 b, int32 e)
bool strConcat(strhandle o, strref s1, strref s2)
int32 strSplit(sa_string *out, strref s, strref sep, bool empty)
bool strConcatC(strhandle o, strhandle sc1, strhandle sc2)
bool strSubStr(strhandle o, strref s, int32 b, int32 e)
void strLower(strhandle io)
bool strPrepend(strref s, strhandle io)
void strUpper(strhandle io)
bool strJoin(strhandle out, sa_string arr, strref sep)
bool strSubStrC(strhandle o, strhandle sc, int32 b, int32 e)
void strSetChar(strhandle str, int32 i, uint8 ch)
Dynamic arrays with type-safe generic programming.
Core string types and fundamental operations.