Kore
Loading...
Searching...
No Matches
filewriter.h File Reference

Provides an API very similar to fwrite and friends but uses a directory that can actually used for persistent file storage. This can later be read using the kinc_file_reader-functions and KINC_FILE_TYPE_SAVE. More...

#include <kinc/global.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  kinc_file_writer

Typedefs

typedef struct kinc_file_writer kinc_file_writer_t

Functions

KINC_FUNC bool kinc_file_writer_open (kinc_file_writer_t *writer, const char *filepath)
 Opens a file for writing.
KINC_FUNC void kinc_file_writer_write (kinc_file_writer_t *writer, void *data, int size)
 Writes data to a file starting from the current writing-position and increases the writing-position accordingly.
KINC_FUNC void kinc_file_writer_close (kinc_file_writer_t *writer)
 Closes a file.

Detailed Description

Provides an API very similar to fwrite and friends but uses a directory that can actually used for persistent file storage. This can later be read using the kinc_file_reader-functions and KINC_FILE_TYPE_SAVE.

Function Documentation

◆ kinc_file_writer_close()

KINC_FUNC void kinc_file_writer_close ( kinc_file_writer_t * writer)

Closes a file.

Parameters
readerThe file to close

◆ kinc_file_writer_open()

KINC_FUNC bool kinc_file_writer_open ( kinc_file_writer_t * writer,
const char * filepath )

Opens a file for writing.

Parameters
readerThe writer to initialize for writing
filepathA filepath to identify a file
Returns
Whether the file could be opened

◆ kinc_file_writer_write()

KINC_FUNC void kinc_file_writer_write ( kinc_file_writer_t * writer,
void * data,
int size )

Writes data to a file starting from the current writing-position and increases the writing-position accordingly.

Parameters
readerThe writer to write to
dataA pointer to read the data from
sizeThe amount of data to write in bytes