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
86 kFx(kStatus) kFile_Close(kFile file);
87
99 kFx(kStatus) kFile_SetWriteBuffer(kFile file, kSize size);
100
112 kFx(kStatus) kFile_SetReadBuffer(kFile file, kSize size);
113
121 kFx(k64u) kFile_Length(kFile file);
122
130 kFx(k64u) kFile_Position(kFile file);
131
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 kEndHeader()
222
223 #include <kApi/Io/kFile.x.h>
224
225 #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:1480
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.