FileWriter handles file outputs for graph saving. More...
#include <FileWriter.h>
Public Member Functions | |
FileWriter (const string &file, bool binary=true) | |
Creates a new FileWriter. | |
~FileWriter () | |
Deletes this FileWriter. | |
template<typename T > | |
void | write (T t) |
Write method. | |
void | magicNumber (int i) |
Writes the magic Number into the file. | |
streampos | tellp () |
Returns the position of the put pointer. | |
void | seekp (streamoff off, ios_base::seekdir dir) |
Sets the position of the put pointer. | |
void | width (streamsize wide) |
Sets a new field width for the output stream. | |
Private Attributes | |
ofstream | out |
Output filestream. | |
bool | isBinary |
If true, the writer is in binary mode. |
FileWriter handles file outputs for graph saving.
Handles binary & ascii.
proland::FileWriter::FileWriter | ( | const string & | file, | |
bool | binary = true | |||
) |
Creates a new FileWriter.
file | the path/name of the file to write into. | |
binary | If true, will write in binary mode. Otherwise, in ASCII. |
proland::FileWriter::~FileWriter | ( | ) |
Deletes this FileWriter.
void proland::FileWriter::magicNumber | ( | int | i | ) | [inline] |
Writes the magic Number into the file.
Magic Number determines if the file is indexed or not.
i | the magic number. If 0 -> basic saving. If 1, indexed saving. |
void proland::FileWriter::seekp | ( | streamoff | off, | |
ios_base::seekdir | dir | |||
) |
Sets the position of the put pointer.
off | integral value of type streamoff representing the offset to be applied relative to an absolute position specified in the dir parameter. | |
dir | seeking direction. It is an object of type ios_base::seekdir that specifies an absolute position from where the offset parameter off is applied. It can take any of the following member constant values: ios_base::beg | ios_base::cur | ios_base::end. |
streampos proland::FileWriter::tellp | ( | ) |
Returns the position of the put pointer.
void proland::FileWriter::width | ( | streamsize | wide | ) |
Sets a new field width for the output stream.
void proland::FileWriter::write | ( | T | t | ) | [inline] |
Write method.
Allows to write all sorts of data in the file.
t | the data to write. |
bool proland::FileWriter::isBinary [private] |
If true, the writer is in binary mode.
ofstream proland::FileWriter::out [private] |
Output filestream.