Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kString.h
Go to the documentation of this file.
1
10 #ifndef K_API_STRING_H
11 #define K_API_STRING_H
12
13 #include <kApi/kApiDef.h>
14
15 kBeginHeader()
16
17
29 //typedef kObject kString; --forward-declared in kApiDef.x.h
30
31
40 kFx(kStatus) kString_Construct(kString* str, const kChar* content, kAlloc allocator);
41
50 kFx(kStatus) kString_Assign(kString str, kString source);
51
59 kFx(kStatus) kString_Clear(kString str);
60
71 kFx(kStatus) kString_Reserve(kString str, kSize minimumCapacity);
72
90 kFx(kStatus) kString_SetLength(kString str, kSize length);
91
100 kFx(kStatus) kString_Set(kString str, const kChar* content);
101
112 kFx(kStatus) kString_Setf(kString str, const kChar* format, ...);
113
123 kFx(kStatus) kString_Setvf(kString str, const kChar* format, kVarArgList argList);
124
133 kFx(kStatus) kString_Add(kString str, const kChar* content);
134
145 kFx(kStatus) kString_Addf(kString str, const kChar* format, ...);
146
156 kFx(kStatus) kString_Addvf(kString str, const kChar* format, kVarArgList argList);
157
168 kFx(kStatus) kString_AddSubstring(kString str, const kChar* content, kSize start, kSize count);
169
183 kFx(k32s) kString_Compare(kString str, const kChar* content);
184
193 kFx(kBool) kString_Equals(kString str, const kChar* content);
194
202 kFx(kStatus) kString_Trim(kString str);
203
216 kFx(kStatus) kString_Split(kString str, const kChar* delimiters, kArrayList* tokens, kAlloc allocator);
217
225 kFx(kChar*) kString_Chars(kString str);
226
237 kFx(kSize) kString_Length(kString str);
238
246 kFx(kSize) kString_Capacity(kString str);
247
250 #define kString_Chars_(STRING) kxString_Chars_(STRING)
251 #define kString_Length_(STRING) kxString_Length_(STRING)
252 #define kString_Capacity_(STRING) kxString_Capacity_(STRING)
253
254
256 kEndHeader()
257
258 #include <kApi/Data/kString.x.h>
259
260 #endif
kString::kString_Set
kStatus kString_Set(kString str, const kChar *content)
Sets the content of the string.
kString::kString_Add
kStatus kString_Add(kString str, const kChar *content)
Appends content to the string.
kString::kString_Setf
kStatus kString_Setf(kString str, const kChar *format,...)
Sets the content of the string using a printf-like format string and arguments.
kString::kString_Equals
kBool kString_Equals(kString str, const kChar *content)
Compares this string to another character sequence to determine equality.
kSize
Represents an unsigned integer that can store a pointer address.
kAlloc
Abstract base class for memory allocator types.
kString::kString_Clear
kStatus kString_Clear(kString str)
Sets the length of the string to zero.
kString::kString_Addvf
kStatus kString_Addvf(kString str, const kChar *format, kVarArgList argList)
Variable-argument version of kString_Addf.
kChar
Represents a single unit (byte) in a UTF-8 character.
kString::kString_Reserve
kStatus kString_Reserve(kString str, kSize minimumCapacity)
Ensures that capacity is reserved for at least the specified number of character units (excluding nul...
kString::kString_Setvf
kStatus kString_Setvf(kString str, const kChar *format, kVarArgList argList)
Variable-argument version of kString_Setf.
kString::kString_Addf
kStatus kString_Addf(kString str, const kChar *format,...)
Appends content to the string using a printf-like format string and arguments.
kString::kString_Chars
kChar * kString_Chars(kString str)
Returns a pointer to the internal character buffer.
kApiDef.h
Core Zen type declarations.
k32s
Represents a 32-bit signed integer.
kString::kString_Split
kStatus kString_Split(kString str, const kChar *delimiters, kArrayList *tokens, kAlloc allocator)
Splits this string into substrings using the supplied delimiters.
kString::kString_Capacity
kSize kString_Capacity(kString str)
Returns the number of character units that can be stored without reallocation.
kString
Represents a character string.
kString::kString_Construct
kStatus kString_Construct(kString *str, const kChar *content, kAlloc allocator)
Constructs a kString object.
kArrayList
Represents a list implemented with a dynamic array.
kStatus
Represents an error code.
kString::kString_Compare
k32s kString_Compare(kString str, const kChar *content)
Compares this string to another string.
kString::kString_Assign
kStatus kString_Assign(kString str, kString source)
Copies the source string content.
kString::kString_AddSubstring
kStatus kString_AddSubstring(kString str, const kChar *content, kSize start, kSize count)
Appends a portion of another string to this string.
kBool
Represents a boolean value.
kString::kString_SetLength
kStatus kString_SetLength(kString str, kSize length)
Explicitly sets the length of the string.
kString::kString_Length
kSize kString_Length(kString str)
Returns the number of character units in the string buffer (excluding null-terminator).
kString::kString_Trim
kStatus kString_Trim(kString str)
Removes leading and trailing whitespace.