Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kFile.h
Go to the documentation of this file.
1
10 #ifndef K_API_FILE_H
11 #define K_API_FILE_H
12
13 #include <kApi/kApiDef.h>
14 #include <kApi/Io/kFile.x.h>
15
22 //typedef kStream kFile; --forward-declared in kApiDef.x.h
23
34 kFx(kStatus) kFile_Load(const kChar* path, void* data, kSize* size, kAlloc allocator);
35
45 kFx(kStatus) kFile_LoadTo(const kChar* path, void* data, kSize capacity);
46
56 kFx(kStatus) kFile_Save(const kChar* path, const void* data, kSize size);
57
68 kFx(kStatus) kFile_Construct(kFile* file, const kChar* path, kFileMode mode, kAlloc allocator);
69
84 kFx(kStatus) kFile_Close(kFile file);
85
97 kFx(kStatus) kFile_SetWriteBuffer(kFile file, kSize size);
98
110 kFx(kStatus) kFile_SetReadBuffer(kFile file, kSize size);
111
119 kFx(k64u) kFile_Length(kFile file);
120
128 kFx(k64u) kFile_Position(kFile file);
129
139 kFx(kBool) kFile_Exists(const kChar* fileName);
140
148 kFx(k64u) kFile_Size(const kChar* fileName);
149
158 kFx(kStatus) kFile_Copy(const kChar* source, const kChar* destination);
159
174 kFx(kStatus) kFile_CopyEx(const kChar* source, const kChar* destination, kCallbackFx progress, kPointer context);
175
184 kFx(kStatus) kFile_Move(const kChar* source, const kChar* destination);
185
200 kFx(kStatus) kFile_MoveEx(const kChar* source, const kChar* destination, kCallbackFx progress, kPointer context);
201
209 kFx(kStatus) kFile_Delete(const kChar* path);
210
219 kFx(kStatus) kFile_TempName(kChar* name, kSize capacity);
220
221 #endif
kFile::kFile_Length
k64u kFile_Length(kFile file)
Returns the current length of the file.
kFile::kFile_Exists
kBool kFile_Exists(const kChar *fileName)
Reports whether the specified file exists.
kFile::kFile_TempName
kStatus kFile_TempName(kChar *name, kSize capacity)
Gets a temporary file name.
kFile::kFile_Copy
kStatus kFile_Copy(const kChar *source, const kChar *destination)
Copies a file to the specified destination.
k64u
Represents a 64-bit unsigned integer.
kPointer
Represents a void pointer.
kSize
Represents an unsigned integer that can store a pointer address.
kAlloc
Abstract base class for memory allocator types.
kFile::kFile_Position
k64u kFile_Position(kFile file)
Returns the current position of the read/write pointer, relative to the beginning of the file...
kFile::kFile_Load
kStatus kFile_Load(const kChar *path, void *data, kSize *size, kAlloc allocator)
Reads the specified file and provides the file contents in an array.
kChar
Represents a single unit (byte) in a UTF-8 character.
kFile::kFile_SetWriteBuffer
kStatus kFile_SetWriteBuffer(kFile file, kSize size)
Sets the size of the buffer used for writing.
kFile::kFile_Close
kStatus kFile_Close(kFile file)
Performs any outstanding I/O operations and closes the underlying file.
kFile::kFile_Delete
kStatus kFile_Delete(const kChar *path)
Deletes the specified file.
kFile
Represents a file stream.
kFile::kFile_Construct
kStatus kFile_Construct(kFile *file, const kChar *path, kFileMode mode, kAlloc allocator)
Constructs a kFile object.
kFile::kFile_MoveEx
kStatus kFile_MoveEx(const kChar *source, const kChar *destination, kCallbackFx progress, kPointer context)
Moves a file to the specified destination with progress feedback.
kApiDef.h
Core Zen type declarations.
kFile::kFile_Move
kStatus kFile_Move(const kChar *source, const kChar *destination)
Moves a file to the specified destination.
kCallbackFx
kStatus(kCall * kCallbackFx)(kPointer receiver, kPointer sender, void *args)
Callback signature for a generic event handler.
Definition: kApiDef.h:1737
kFileMode
Flags that control how a file is opened.
kFile::kFile_Size
k64u kFile_Size(const kChar *fileName)
Reports the size the specified file, in bytes.
kStatus
Represents an error code.
kFile::kFile_LoadTo
kStatus kFile_LoadTo(const kChar *path, void *data, kSize capacity)
Reads the specified file into the provided array.
kBool
Represents a boolean value.
kFile::kFile_SetReadBuffer
kStatus kFile_SetReadBuffer(kFile file, kSize size)
Sets the size of the buffer used for reading.
kFile::kFile_CopyEx
kStatus kFile_CopyEx(const kChar *source, const kChar *destination, kCallbackFx progress, kPointer context)
Copies a file to the specified destination with progress feedback.
kFile::kFile_Save
kStatus kFile_Save(const kChar *path, const void *data, kSize size)
Saves the specified data to the specified file.