Simple++
Powerfull and lightning fast C++ Library
Static Public Member Functions | List of all members
IO Class Reference

#include <IO.h>

Inheritance diagram for IO:
SimpleIO

Static Public Member Functions

static size_t readToBuffer (std::fstream *fileStream, char **data)
 read the complete file stream (from begin to end) and allocate a new data and copy data inside. More...
 
static size_t readToBuffer (const WString &fileName, char **data)
 open the file and read the complete file (from begin to end) and allocate a new data and copy data inside. More...
 
- Static Public Member Functions inherited from SimpleIO
template<typename C >
static bool write (std::fstream *fileStream, C *object)
 write an object inside the file stream, this function will automatically test if the sent object (by pointer) inherit from BasicIO himself and then call his own write method. More...
 
template<typename C >
static bool read (std::fstream *fileStream, C *object)
 read from a file stream to an object, this function will automatically test if the sent object (by pointer) inherit from BasicIO himself and then call his own read method. More...
 
template<typename C >
static bool writeBuffer (std::fstream *fileStream, C *buffer, size_t size)
 write a table of objects inside the file stream, this function will automatically test for each object inherit from BasicIO themselves and then call there own write method. More...
 
template<typename C >
static bool readBuffer (std::fstream *fileStream, C *buffer, size_t size)
 read from a file stream to a table of objects, this function will automatically test for each object inherit from BasicIO themselves and then call there own write method. More...
 

Member Function Documentation

size_t IO::readToBuffer ( std::fstream *  fileStream,
char **  data 
)
static

read the complete file stream (from begin to end) and allocate a new data and copy data inside.

Parameters
fileStreamfile stream to read.
data[out] data buffer to be allocated and filled with the content of the file stream.
Returns
number of char read.
size_t IO::readToBuffer ( const WString fileName,
char **  data 
)
static

open the file and read the complete file (from begin to end) and allocate a new data and copy data inside.

Parameters
fileNamefile to read.
data[out] data buffer to be allocated and filled with the content of the file.
Returns
number of char read (-1) if an error has occurred.

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