Input binary archive. More...


Public Member Functions | |
IBinaryArchive (const std::string &name, const std::string &extension, int block=-1) | |
IBinaryArchive (const std::string &name, int block=-1) | |
bool | checkVersion (int version) |
std::istream & | getStream () |
void | open (const std::string &name, const std::string &extension, int block=-1) |
void | open (const std::string &name, int block=-1) |
![]() | |
BinaryArchive () | |
~BinaryArchive () | |
std::string | getHeader () const |
std::string | getPath () const |
int | getVersion () const |
Additional Inherited Members | |
![]() | |
static std::string | generatePath (const std::string &name, const std::string &extension, int block=-1) |
static std::string | generatePath (const std::string &name, int block=-1) |
![]() | |
static BITPIT_PUBLIC_API const std::string | EXTENSION_DEFAULT = "dat" |
static BITPIT_PUBLIC_API const int | HEADER_SIZE = 1024 |
static BITPIT_PUBLIC_API const int | VERSION_UNDEFINED = - std::numeric_limits<int>::max() |
![]() | |
void | open (const std::string &name, const std::string &extension, ios_base::openmode mode, int block=-1) |
![]() | |
std::string | m_header |
std::string | m_path |
int | m_version |
Detailed Description
Input binary archive.
The IBinaryArchive class can read a binary archive, the binary archive has a fixed ASCII header.
- Examples
- POD_example_00002.cpp.
Definition at line 67 of file binary_archive.hpp.
Constructor & Destructor Documentation
◆ IBinaryArchive() [1/2]
bitpit::IBinaryArchive::IBinaryArchive | ( | const std::string & | name, |
int | block = -1 ) |
Creates a new input archive.
- Parameters
-
name is the name of the file block is the parallel block thefile belongs to, a negative value mean that the file is serial
Definition at line 162 of file binary_archive.cpp.
◆ IBinaryArchive() [2/2]
bitpit::IBinaryArchive::IBinaryArchive | ( | const std::string & | name, |
const std::string & | extension, | ||
int | block = -1 ) |
Creates a new input archive.
- Parameters
-
name is the name of the file extension is the extension of the file block is the parallel block thefile belongs to, a negative value mean that the file is serial
Definition at line 175 of file binary_archive.cpp.
Member Function Documentation
◆ checkVersion()
bool bitpit::IBinaryArchive::checkVersion | ( | int | version | ) |
Checks if the version of the archive matches the specified version.
- Parameters
-
version is the requested version
- Returns
- Retuns true if the version of the archive matches the specified version, otherwise it returns false.
Definition at line 236 of file binary_archive.cpp.
◆ getStream()
std::istream & bitpit::IBinaryArchive::getStream | ( | ) |
Get a reference to the input stream associated to the archive.
- Returns
- A reference to the input stream associated to the archive.
- Examples
- POD_example_00002.cpp.
Definition at line 224 of file binary_archive.cpp.
◆ open() [1/2]
void bitpit::IBinaryArchive::open | ( | const std::string & | name, |
const std::string & | extension, | ||
int | block = -1 ) |
Opens the specified file, associating it with the stream object, so that input/output operations are performed on its content.
- Parameters
-
name is the name of the file extension is the extension of the file block is the parallel block thefile belongs to, a negative value mean that the file is serial
Definition at line 202 of file binary_archive.cpp.
◆ open() [2/2]
void bitpit::IBinaryArchive::open | ( | const std::string & | name, |
int | block = -1 ) |
Opens the specified file, associating it with the stream object, so that input/output operations are performed on its content.
- Parameters
-
name is the name of the file block is the parallel block thefile belongs to, a negative value mean that the file is serial
Definition at line 188 of file binary_archive.cpp.
The documentation for this class was generated from the following files:
- src/IO/binary_archive.hpp
- src/IO/binary_archive.cpp
