Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kUtils.h
Go to the documentation of this file.
1
10 #include <kApi/kApiDef.h> //--inclusion order controlled by kApiDef
11
12 #ifndef K_API_UTILS_H
13 #define K_API_UTILS_H
14
15 kBeginHeader()
16
17
31 kFx(kStatus) kDestroyRef(kObject* object);
32
40 kFx(kStatus) kDisposeRef(kObject* object);
41
50 kFx(kStatus) kShareRef(kObject* object, kObject source);
51
61 kFx(kStatus) kLoad5(kObject* object, const kChar* fileName, kAlloc allocator);
62
71 kFx(kStatus) kSave5(kObject object, const kChar* fileName);
72
82 kFx(kStatus) kLoad6(kObject* object, const kChar* fileName, kAlloc allocator);
83
92 kFx(kStatus) kSave6(kObject object, const kChar* fileName);
93
104 kFx(kStatus) kMemAlloc(kSize size, void* mem);
105
116 kFx(kStatus) kMemAllocZero(kSize size, void* mem);
117
125 kFx(kStatus) kMemFree(void* mem);
126
134 kFx(kStatus) kMemFreeRef(void* mem);
135
145 kFx(kStatus) kMemSet(void* dest, kByte fill, kSize size);
146
156 kFx(kStatus) kMemCopy(void* dest, const void* src, kSize size);
157
167 kFx(kStatus) kMemMove(void* dest, const void* src, kSize size);
168
178 kFx(kBool) kMemEquals(const void* a, const void* b, kSize size);
179
194 kFx(kStatus) kStrCopy(kChar* dest, kSize capacity, const kChar* src);
195
210 kFx(kStatus) kStrCat(kChar* dest, kSize capacity, const kChar* src);
211
221 kFx(kStatus) kStrToLower(kChar* str);
222
231 kFx(kBool) kStrEquals(const kChar* a, const kChar* b);
232
246 kFx(k32s) kStrCompare(const kChar* a, const kChar* b);
247
258 kFx(k32s) kStrCompareLower(const kChar* a, const kChar* b);
259
267 kFx(kSize) kStrLength(const kChar* str);
268
277 kFx(const kChar*) kStrFindFirst(const kChar* str, const kChar* subStr);
278
287 kFx(const kChar*) kStrFindLast(const kChar* str, const kChar* subStr);
288
303 kFx(kStatus) kStrPrintf(kChar* dest, kSize capacity, const kChar* format, ...);
304
316 kFx(kStatus) kStrPrintvf(kChar* dest, kSize capacity, const kChar* format, kVarArgList argList);
317
326 kFx(kStatus) kLogf(const kChar* format, ...);
327
337 kFx(kStatus) kLogvf(const kChar* format, kVarArgList argList);
338
345 kFx(k32u) kRandom32u();
346
353 kFx(k64u) kRandom64u();
354
361 kFx(kSize) kRandomSize();
362
363 kEndHeader()
364
365 #include <kApi/Utils/kUtils.x.h>
366
367 #endif
kUtils::kStrLength
kSize kStrLength(const kChar *str)
Determines the number of kChar units in a characater sequence.
k32u
Represents a 32-bit unsigned integer.
kUtils::kStrPrintvf
kStatus kStrPrintvf(kChar *dest, kSize capacity, const kChar *format, kVarArgList argList)
Variable-argument version of kStrPrintf.
kUtils::kMemFree
kStatus kMemFree(void *mem)
Frees a block of memory that was allocated using kMemAlloc or kMemAllocZero.
k64u
Represents a 64-bit unsigned integer.
kUtils::kLoad5
kStatus kLoad5(kObject *object, const kChar *fileName, kAlloc allocator)
Loads an object from file using kDat-5 serialization.
kUtils::kStrCat
kStatus kStrCat(kChar *dest, kSize capacity, const kChar *src)
Appends characters from source to destination.
kUtils::kMemMove
kStatus kMemMove(void *dest, const void *src, kSize size)
Copies memory from a source buffer to a potentially-overlapping destination.
kUtils::kStrCompareLower
k32s kStrCompareLower(const kChar *a, const kChar *b)
Performs a case-insenstive comparison of two strings.
kUtils::kLogvf
kStatus kLogvf(const kChar *format, kVarArgList argList)
Variable-argument version of kLogf.
kUtils::kStrFindLast
const kChar * kStrFindLast(const kChar *str, const kChar *subStr)
Finds the last occurrence of a character sequence.
kUtils::kStrEquals
kBool kStrEquals(const kChar *a, const kChar *b)
Tests a pair of character sequences for equality.
kUtils::kSave5
kStatus kSave5(kObject object, const kChar *fileName)
Saves an object to file using kDat-5 serialization.
kSize
Represents an unsigned integer that can store a pointer address.
kAlloc
Abstract base class for memory allocator types.
kUtils::kMemAlloc
kStatus kMemAlloc(kSize size, void *mem)
Allocates a block of memory from the application heap.
kUtils::kShareRef
kStatus kShareRef(kObject *object, kObject source)
Shares an object and sets a handle to refer to the shared object.
kUtils::kStrCompare
k32s kStrCompare(const kChar *a, const kChar *b)
Compares one string to another.
kUtils::kStrToLower
kStatus kStrToLower(kChar *str)
Converts characters in the given sequence to lower case.
kUtils::kMemEquals
kBool kMemEquals(const void *a, const void *b, kSize size)
Compares one memory buffer with another.
kUtils::kMemCopy
kStatus kMemCopy(void *dest, const void *src, kSize size)
Copies memory from a source buffer to a non-overlapping destination.
kChar
Represents a single unit (byte) in a UTF-8 character.
kByte
Represents a byte on the current platform.
kUtils::kDisposeRef
kStatus kDisposeRef(kObject *object)
Disposes an object and resets the object handle to kNULL.
kUtils::kMemFreeRef
kStatus kMemFreeRef(void *mem)
Frees a block of memory that was allocated using kMemAlloc or kMemAllocZero and resets the memory poi...
kUtils::kRandom32u
k32u kRandom32u()
Generates a random 32-bit number.
kUtils::kDestroyRef
kStatus kDestroyRef(kObject *object)
Destroys an object and resets the object handle to kNULL.
kUtils::kLogf
kStatus kLogf(const kChar *format,...)
Writes to logging handler (if registered).
kUtils::kSave6
kStatus kSave6(kObject object, const kChar *fileName)
Saves an object to file using kDat-6 serialization.
kUtils::kLoad6
kStatus kLoad6(kObject *object, const kChar *fileName, kAlloc allocator)
Loads an object from file using kDat-6 serialization.
kUtils::kMemAllocZero
kStatus kMemAllocZero(kSize size, void *mem)
Allocates and zero-initializes block of memory from the application heap.
kApiDef.h
Core Zen type declarations.
k32s
Represents a 32-bit signed integer.
kUtils::kRandom64u
k64u kRandom64u()
Generates a random 64-bit number.
kUtils::kStrPrintf
kStatus kStrPrintf(kChar *dest, kSize capacity, const kChar *format,...)
Formats a string using printf-style arguments.
kUtils::kStrCopy
kStatus kStrCopy(kChar *dest, kSize capacity, const kChar *src)
Copies characters from source to destination.
kUtils::kRandomSize
kSize kRandomSize()
Generates a random number of type kSize.
kObject
Root of all Zen classes.
kStatus
Represents an error code.
kUtils::kStrFindFirst
const kChar * kStrFindFirst(const kChar *str, const kChar *subStr)
Finds the first occurrence of a character sequence.
kBool
Represents a boolean value.
kUtils::kMemSet
kStatus kMemSet(void *dest, kByte fill, kSize size)
Sets a block of memory to the given byte value.