24#ifndef __BITPIT_BINARY_ARCHIVE_HPP__
25#define __BITPIT_BINARY_ARCHIVE_HPP__
32#include "bitpit_common.hpp"
40 BITPIT_PUBLIC_API
static const int HEADER_SIZE = 1024;
41 BITPIT_PUBLIC_API
static const int VERSION_UNDEFINED = - std::numeric_limits<int>::max();
43 BITPIT_PUBLIC_API
static const std::string EXTENSION_DEFAULT;
45 static std::string
generatePath(
const std::string &name,
int block = -1);
46 static std::string
generatePath(
const std::string &name,
const std::string &extension,
int block = -1);
48 using std::fstream::close;
62 void open(
const std::string &name,
const std::string &extension,
63 ios_base::openmode mode,
int block = -1);
73 IBinaryArchive(
const std::string &name,
const std::string &extension,
int block = -1);
75 void open(
const std::string &name,
int block = -1);
76 void open(
const std::string &name,
const std::string &extension,
int block = -1);
82 using BinaryArchive::operator>>;
83 using BinaryArchive::read;
94 OBinaryArchive(
const std::string &name,
int version,
const std::string &header,
96 OBinaryArchive(
const std::string &name,
const std::string &extension,
int version,
98 OBinaryArchive(
const std::string &name,
const std::string &extension,
int version,
99 const std::string &header,
int block = -1);
101 void open(
const std::string &name,
const int version,
103 void open(
const std::string &name,
int version,
const std::string &header,
105 void open(
const std::string &name,
const std::string &extension,
int version,
107 void open(
const std::string &name,
const std::string &extension,
int version,
108 const std::string &header,
int block = -1);
112 using BinaryArchive::operator<<;
113 using BinaryArchive::write;
Base class for binary archives.
std::string getHeader() const
static std::string generatePath(const std::string &name, int block=-1)
void open(const std::string &name, const std::string &extension, ios_base::openmode mode, int block=-1)
std::string getPath() const
bool checkVersion(int version)
void open(const std::string &name, int block=-1)
std::istream & getStream()
void open(const std::string &name, const int version, int block=-1)
std::ostream & getStream()