Tramway SDK
Public Member Functions | List of all members
tram::FileWriter Class Reference

#include <file.h>

Public Member Functions

 FileWriter (const char *path, FileSource source=SOURCE_ANY)
 Opens a file for writing. More...
 
 ~FileWriter ()
 Closes the file for writing. More...
 
bool is_open ()
 Checks if a file was opened for writing. More...
 
void write (const char *data, size_t length)
 Writes to a file. More...
 

Constructor & Destructor Documentation

◆ FileWriter()

tram::FileWriter::FileWriter ( const char *  path,
FileSource  source = SOURCE_ANY 
)

Opens a file for writing.

Parameters
pathPath to the file.
sourceSource to which the file will be written.

◆ ~FileWriter()

tram::FileWriter::~FileWriter ( )

Closes the file for writing.

Member Function Documentation

◆ is_open()

bool tram::FileWriter::is_open ( )

Checks if a file was opened for writing.

◆ write()

void tram::FileWriter::write ( const char *  data,
size_t  length 
)

Writes to a file.

Note
This will completely overwrite the file contents.
Parameters
dataData which will be written to the file.
lengthLength of the data, in bytes, pointed to by data parameter.

The documentation for this class was generated from the following files: