Zen API
 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
k64u kFile_Length(kFile file)
Returns the current length of the file.
kBool kFile_Exists(const kChar *fileName)
Reports whether the specified file exists.
kStatus kFile_TempName(kChar *name, kSize capacity)
Gets a temporary file name.
kStatus kFile_Copy(const kChar *source, const kChar *destination)
Copies a file to the specified destination.
Represents a 64-bit unsigned integer.
Represents a void pointer.
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
k64u kFile_Position(kFile file)
Returns the current position of the read/write pointer, relative to the beginning of the file...
kStatus kFile_Load(const kChar *path, void *data, kSize *size, kAlloc allocator)
Reads the specified file and provides the file contents in an array.
Represents a single unit (byte) in a UTF-8 character.
kStatus kFile_SetWriteBuffer(kFile file, kSize size)
Sets the size of the buffer used for writing.
kStatus kFile_Close(kFile file)
Performs any outstanding I/O operations and closes the underlying file.
kStatus kFile_Delete(const kChar *path)
Deletes the specified file.
Represents a file stream.
kStatus kFile_Construct(kFile *file, const kChar *path, kFileMode mode, kAlloc allocator)
Constructs a kFile object.
kStatus kFile_MoveEx(const kChar *source, const kChar *destination, kCallbackFx progress, kPointer context)
Moves a file to the specified destination with progress feedback.
Core Zen type declarations.
kStatus kFile_Move(const kChar *source, const kChar *destination)
Moves a file to the specified destination.
kStatus(kCall * kCallbackFx)(kPointer receiver, kPointer sender, void *args)
Callback signature for a generic event handler.
Definition: kApiDef.h:1806
Flags that control how a file is opened.
k64u kFile_Size(const kChar *fileName)
Reports the size the specified file, in bytes.
Represents an error code.
kStatus kFile_LoadTo(const kChar *path, void *data, kSize capacity)
Reads the specified file into the provided array.
Represents a boolean value.
kStatus kFile_SetReadBuffer(kFile file, kSize size)
Sets the size of the buffer used for reading.
kStatus kFile_CopyEx(const kChar *source, const kChar *destination, kCallbackFx progress, kPointer context)
Copies a file to the specified destination with progress feedback.
kStatus kFile_Save(const kChar *path, const void *data, kSize size)
Saves the specified data to the specified file.