proland::FileReader Class Reference
[graph]

FileReader handles file inputs for graph loading. More...

#include <FileReader.h>

List of all members.

Public Member Functions

 FileReader (const string &file, bool &isIndexed)
 Creates a new FileReader.
 ~FileReader ()
 Deletes this FileReader.
template<typename T >
read ()
 Templated read Method.
streampos tellg ()
 Returns the position of the get pointer.
void seekg (streamoff off, ios_base::seekdir dir)
 Sets the position of the get pointer.
bool error ()
 Returns true if an error occured while reading.

Private Attributes

ifstream in
 The input filestream.
bool isBinary
 If true, file will be read as binary.

Detailed Description

FileReader handles file inputs for graph loading.

Handles binary & ascii.

Author:
Antoine Begault

Constructor & Destructor Documentation

proland::FileReader::FileReader ( const string &  file,
bool &  isIndexed 
)

Creates a new FileReader.

Parameters:
file the path/name of the file to read.
isIndexed after function call, will be true if the magic number was 1. False otherwise.
proland::FileReader::~FileReader (  ) 

Deletes this FileReader.


Member Function Documentation

bool proland::FileReader::error (  ) 

Returns true if an error occured while reading.

The errors corresponds to ifstream errors.

template<typename T >
T proland::FileReader::read (  )  [inline]

Templated read Method.

Example : read<int>().

Returns:
a T value read from the input file stream at get pointer.
void proland::FileReader::seekg ( streamoff  off,
ios_base::seekdir  dir 
)

Sets the position of the get pointer.

The get pointer determines the next location to be read in the source associated to the stream.

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::FileReader::tellg (  ) 

Returns the position of the get pointer.


Member Data Documentation

ifstream proland::FileReader::in [private]

The input filestream.

If true, file will be read as binary.

Otherwise, ASCII.


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