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
15 kBeginHeader()
16
17
23 //typedef kStream kFile; --forward-declared in kApiDef.x.h
24
25
35 kFx(kStatus) kFile_Load(const kChar* path, void* data, kSize* size, kAlloc allocator);
36
46 kFx(kStatus) kFile_LoadTo(const kChar* path, void* data, kSize capacity);
47
57 kFx(kStatus) kFile_Save(const kChar* path, const kByte* data, kSize size);
58
69 kFx(kStatus) kFile_Construct(kFile* file, const kChar* path, kFileMode mode, kAlloc allocator);
70
85 kFx(kStatus) kFile_Close(kFile file);
86
98 kFx(kStatus) kFile_SetWriteBuffer(kFile file, kSize size);
99
111 kFx(kStatus) kFile_SetReadBuffer(kFile file, kSize size);
112
120 kFx(k64u) kFile_Length(kFile file);
121
129 kFx(k64u) kFile_Position(kFile file);
130
138 kFx(kBool) kFile_Exists(const kChar* fileName);
139
147 kFx(k64u) kFile_Size(const kChar* fileName);
148
157 kFx(kStatus) kFile_Copy(const kChar* source, const kChar* destination);
158
173 kFx(kStatus) kFile_CopyEx(const kChar* source, const kChar* destination, kCallbackFx progress, kPointer context);
174
183 kFx(kStatus) kFile_Move(const kChar* source, const kChar* destination);
184
199 kFx(kStatus) kFile_MoveEx(const kChar* source, const kChar* destination, kCallbackFx progress, kPointer context);
200
208 kFx(kStatus) kFile_Delete(const kChar* path);
209
218 kFx(kStatus) kFile_TempName(kChar* name, kSize capacity);
219
220 kEndHeader()
221
222 #include <kApi/Io/kFile.x.h>
223
224 #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_Save
kStatus kFile_Save(const kChar *path, const kByte *data, kSize size)
Saves the specified data to the specified file.
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.
kByte
Represents a byte on the current platform.
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:1508
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.