Public Member Functions

File_Stream< T > Class Template Reference

A template class to work with files using Simple_Stream interface. Please note that class works in 2 modes: read and append (in latter case creates file if non-existent). Mode of operation is determined based on first method called: if Read() was called first then mode is set to read, in case of Write() call, append mode is selected. More...

#include <File_Stream.h>

Inheritance diagram for File_Stream< T >:
Inheritance graph
[legend]
Collaboration diagram for File_Stream< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 File_Stream (const wchar_t *file_name)
 Constructor, takes file name as argument.
virtual int Read (T *buf, size_t count, size_t *read)
 Reads a number of T values from stream.
virtual int Write (T *buf, size_t count, size_t *written)
 Writes a number of T values to stream.
virtual int Flush ()
 Flushes the internal buffer, useful when you need to make sure the data is passed to the Stream backend (could be some file) from Stream internal buffer.

Detailed Description

template<typename T>
class MCPN::File_Stream< T >

A template class to work with files using Simple_Stream interface. Please note that class works in 2 modes: read and append (in latter case creates file if non-existent). Mode of operation is determined based on first method called: if Read() was called first then mode is set to read, in case of Write() call, append mode is selected.

MCPN Logo
kr0st © 2010