Pol  Rev 533
BinaryFile Class Reference

#include <binaryfile.h>

+ Collaboration diagram for BinaryFile:

List of all members.

Public Member Functions

 BinaryFile ()
 BinaryFile (const std::string &filename, ios::openmode mode)
 ~BinaryFile ()
void Close ()
fstream::pos_type FileSize ()
void Open (const std::string &filename, ios::openmode mode)
template<class T >
void Read (T &val)
template<class T >
void Read (T *arr, size_t count)
template<class T >
void ReadVector (vector< T > &vec)
void Seek (fstream::pos_type abs_offset)

Private Member Functions

size_t GetElementCount (size_t elemsize)
void ReadBuffer (void *buffer, streamsize length)

Private Attributes

fstream _file
std::string _filename

Detailed Description

Definition at line 13 of file binaryfile.h.


Constructor & Destructor Documentation

Definition at line 18 of file binaryfile.cpp.

BinaryFile::BinaryFile ( const std::string &  filename,
ios::openmode  mode 
)

Definition at line 22 of file binaryfile.cpp.

References Open().

+ Here is the call graph for this function:

Definition at line 28 of file binaryfile.cpp.


Member Function Documentation

Definition at line 43 of file binaryfile.cpp.

References _file, _filename, and passert.

fstream::pos_type BinaryFile::FileSize ( )

Definition at line 65 of file binaryfile.cpp.

References _file, _filename, and passert.

Referenced by GetElementCount(), and MapServer::LoadSecondLevelIndex().

+ Here is the caller graph for this function:

size_t BinaryFile::GetElementCount ( size_t  elemsize) [private]

Definition at line 85 of file binaryfile.cpp.

References _filename, decint(), FileSize(), and filesize().

Referenced by ReadVector().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BinaryFile::Open ( const std::string &  filename,
ios::openmode  mode 
)

Definition at line 32 of file binaryfile.cpp.

References _file, _filename, binary(), hexint(), and passert.

Referenced by BinaryFile(), and FileMapServer::FileMapServer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T >
void BinaryFile::Read ( T &  val) [inline]

Definition at line 24 of file binaryfile.h.

References ReadBuffer().

Referenced by FileMapServer::FileMapServer(), FileMapServer::GetMapCell(), MapTileServer::GetMapTile(), MapServer::LoadFirstLevelIndex(), MapServer::LoadSecondLevelIndex(), MapTileServer::MapTileServer(), and ReadVector().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T >
void BinaryFile::Read ( T *  arr,
size_t  count 
) [inline]

Definition at line 30 of file binaryfile.h.

References ReadBuffer().

+ Here is the call graph for this function:

void BinaryFile::ReadBuffer ( void *  buffer,
streamsize  length 
) [private]

Definition at line 59 of file binaryfile.cpp.

References _file, _filename, and decint().

Referenced by Read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T >
void BinaryFile::ReadVector ( vector< T > &  vec) [inline]

Definition at line 36 of file binaryfile.h.

References GetElementCount(), and Read().

Referenced by MapServer::LoadSolids(), and StaticServer::StaticServer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BinaryFile::Seek ( fstream::pos_type  abs_offset)

Definition at line 51 of file binaryfile.cpp.

References _file, _filename, and passert.

Referenced by FileMapServer::GetMapCell(), MapTileServer::GetMapTile(), and MapServer::LoadSecondLevelIndex().

+ Here is the caller graph for this function:


Member Data Documentation

fstream BinaryFile::_file [private]

Definition at line 51 of file binaryfile.h.

Referenced by Close(), FileSize(), Open(), ReadBuffer(), and Seek().

std::string BinaryFile::_filename [private]

Definition at line 52 of file binaryfile.h.

Referenced by Close(), FileSize(), GetElementCount(), Open(), ReadBuffer(), and Seek().


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