Simple C Expat Wrapper (SCEW)  1.1.7
Files | Functions
Files

Write data to files. More...

Files

file  writer_file.h
 SCEW writer functions for files.
 

Functions

SCEW_API scew_writerscew_writer_file_create (char const *file_name)
 Creates a new SCEW writer for the given file name. More...
 
SCEW_API scew_writerscew_writer_fp_create (FILE *file)
 Creates a new SCEW writer for the given file stream. More...
 

Detailed Description

Write data to files.

Function Documentation

SCEW_API scew_writer* scew_writer_file_create ( char const *  file_name)

Creates a new SCEW writer for the given file name.

This routine will create a new file if the file does not exist or it will overwrite the existing one. The file will be created in text mode. Once the writer is created, the Writers routines must be called in order to store data to the file or to know the file status.

For UTF-16 encoding (only in Windows paltforms) the BOM (Byte Order Mask) is automatically handled by the Windows API.

Precondition
file_name != NULL
Parameters
file_namethe file name to create for the new SCEW writer.
Returns
a new SCEW writer for the given file name or NULL if the writer could not be created (e.g. memory allocation, file permissions, etc.).
SCEW_API scew_writer* scew_writer_fp_create ( FILE *  file)

Creates a new SCEW writer for the given file stream.

The file stream is created in text mode. Once the writer is created, any of the Writers routines must be called in order to store data to the file or to know the file status.

For UTF-16 encoding (only in Windows paltforms) the BOM (Byte Order Mask) is automatically handled by the Windows API.

Precondition
file != NULL
Parameters
filethe file where the new SCEW writer will write to.
Returns
a new SCEW writer for the given file stream or NULL if the writer could not be created (e.g. memory allocation, file permissions, etc.).