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

Provides an API very similar to fwrite and friends but uses a directory that provides persistent file storage. This can later be read using the kore_file_reader-functions and KORE_FILE_TYPE_SAVE. More...

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

Go to the source code of this file.

Data Structures

struct  kore_file_writer

Typedefs

typedef struct kore_file_writer kore_file_writer

Functions

KORE_FUNC bool kore_file_writer_open (kore_file_writer *writer, const char *filepath)
 Opens a file for writing.
KORE_FUNC void kore_file_writer_write (kore_file_writer *writer, void *data, int size)
 Writes data to a file starting from the current writing-position and increases the writing-position accordingly.
KORE_FUNC void kore_file_writer_close (kore_file_writer *writer)
 Closes a file.

Detailed Description

Provides an API very similar to fwrite and friends but uses a directory that provides persistent file storage. This can later be read using the kore_file_reader-functions and KORE_FILE_TYPE_SAVE.

Function Documentation

◆ kore_file_writer_close()

KORE_FUNC void kore_file_writer_close ( kore_file_writer * writer)

Closes a file.

Parameters
readerThe file to close

◆ kore_file_writer_open()

KORE_FUNC bool kore_file_writer_open ( kore_file_writer * 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

◆ kore_file_writer_write()

KORE_FUNC void kore_file_writer_write ( kore_file_writer * 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