proland::FileWriter Class Reference
[graph]

FileWriter handles file outputs for graph saving. More...

#include <FileWriter.h>

List of all members.

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.

Detailed Description

FileWriter handles file outputs for graph saving.

Handles binary & ascii.

Author:
Antoine Begault

Constructor & Destructor Documentation

proland::FileWriter::FileWriter ( const string &  file,
bool  binary = true 
)

Creates a new FileWriter.

Parameters:
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.


Member Function Documentation

void proland::FileWriter::magicNumber ( int  i  )  [inline]

Writes the magic Number into the file.

Magic Number determines if the file is indexed or not.

Parameters:
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.

Parameters:
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.

template<typename T >
void proland::FileWriter::write ( t  )  [inline]

Write method.

Allows to write all sorts of data in the file.

Parameters:
t the data to write.

Member Data Documentation

If true, the writer is in binary mode.

ofstream proland::FileWriter::out [private]

Output filestream.


Generated on Sat May 12 09:42:47 2012 for proland by  doxygen 1.6.1