|
Pol
Revision:cb584c9
|
#include <binaryfile.h>
Public Member Functions | |
| BinaryFile () | |
| BinaryFile (const std::string &filename, std::ios::openmode mode) | |
| ~BinaryFile () | |
| void | Close () |
| std::fstream::pos_type | FileSize () |
| void | Open (const std::string &filename, std::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 (std::vector< T > &vec) |
| void | Seek (std::fstream::pos_type abs_offset) |
| size_t | sizeEstimate () const |
Private Member Functions | |
| size_t | GetElementCount (size_t elemsize) |
| void | ReadBuffer (void *buffer, std::streamsize length) |
Private Attributes | |
| std::fstream | _file |
| std::string | _filename |
Definition at line 18 of file binaryfile.h.
| Pol::Clib::BinaryFile::BinaryFile | ( | ) |
Definition at line 21 of file binaryfile.cpp.
| Pol::Clib::BinaryFile::BinaryFile | ( | const std::string & | filename, |
| std::ios::openmode | mode | ||
| ) |
Definition at line 23 of file binaryfile.cpp.
References Open().
| Pol::Clib::BinaryFile::~BinaryFile | ( | ) |
Definition at line 28 of file binaryfile.cpp.
| void Pol::Clib::BinaryFile::Close | ( | ) |
Definition at line 42 of file binaryfile.cpp.
| std::fstream::pos_type Pol::Clib::BinaryFile::FileSize | ( | ) |
Definition at line 65 of file binaryfile.cpp.
References _file, _filename, and passert.
Referenced by GetElementCount(), Pol::Plib::MapServer::LoadSecondLevelIndex(), and ReadVector().
|
private |
Definition at line 89 of file binaryfile.cpp.
References _filename, Pol::Clib::decint(), FileSize(), and Pol::Clib::filesize().
Referenced by ReadVector().
| void Pol::Clib::BinaryFile::Open | ( | const std::string & | filename, |
| std::ios::openmode | mode | ||
| ) |
Definition at line 30 of file binaryfile.cpp.
References _file, _filename, Pol::Clib::binary(), Pol::Clib::hexint(), and passert.
Referenced by BinaryFile(), and Pol::Plib::FileMapServer::FileMapServer().
|
inline |
Definition at line 29 of file binaryfile.h.
References ReadBuffer().
Referenced by Pol::Plib::FileMapServer::FileMapServer(), Pol::Plib::FileMapServer::GetMapCell(), Pol::Plib::MapTileServer::GetMapTile(), Pol::Plib::MapServer::LoadFirstLevelIndex(), Pol::Plib::MapServer::LoadSecondLevelIndex(), Pol::Plib::MapTileServer::MapTileServer(), and ReadVector().
|
inline |
Definition at line 35 of file binaryfile.h.
References ReadBuffer().
|
private |
Definition at line 58 of file binaryfile.cpp.
References _file, _filename, and Pol::Clib::decint().
Referenced by Read(), and ReadVector().
|
inline |
Definition at line 41 of file binaryfile.h.
References Pol::UoTool::buffer, FileSize(), GetElementCount(), Read(), ReadBuffer(), Seek(), and sizeEstimate().
Referenced by Pol::Plib::MapServer::LoadSolids(), and Pol::Plib::StaticServer::StaticServer().
| void Pol::Clib::BinaryFile::Seek | ( | std::fstream::pos_type | abs_offset | ) |
Definition at line 50 of file binaryfile.cpp.
References _file, _filename, and passert.
Referenced by Pol::Plib::FileMapServer::GetMapCell(), Pol::Plib::MapTileServer::GetMapTile(), Pol::Plib::MapServer::LoadSecondLevelIndex(), and ReadVector().
| size_t Pol::Clib::BinaryFile::sizeEstimate | ( | ) | const |
Definition at line 101 of file binaryfile.cpp.
References _filename.
Referenced by ReadVector(), Pol::Plib::MapTileServer::sizeEstimate(), and Pol::Plib::FileMapServer::sizeEstimate().
|
private |
Definition at line 57 of file binaryfile.h.
Referenced by Close(), FileSize(), Open(), ReadBuffer(), and Seek().
|
private |
Definition at line 58 of file binaryfile.h.
Referenced by Close(), FileSize(), GetElementCount(), Open(), ReadBuffer(), Seek(), and sizeEstimate().