binaryIO.h
Go to the documentation of this file.
/* binaryIO.h
*/
#ifndef OSL_BINARYIO_H
#define OSL_BINARYIO_H
#include <vector>
#include <memory>
#include <iosfwd>
namespace osl
{
namespace misc
{
struct BinaryWriter
{
static void write(std::ostream&, const std::vector<int>& data);
static void write(std::ostream&, const std::vector<double>& data);
};
template <class T>
class BinaryReader
{
public:
explicit BinaryReader(std::istream& is);
~BinaryReader();
bool read(std::vector<T>& data);
static size_t blockSize();
private:
struct State;
std::unique_ptr<State> state;
};
template <class T>
class BinaryElementReader
{
public:
explicit BinaryElementReader(std::istream& is);
~BinaryElementReader();
T read();
bool hasNext() const;
bool failed() const;
private:
struct State;
std::unique_ptr<State> state;
};
}
}
#endif /* OSL_BINARYIO_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::misc::BinaryElementReader::BinaryElementReader
BinaryElementReader(std::istream &is)
Definition binaryIO.cc:141
osl::misc::BinaryElementReader::read
T read()
Definition binaryIO.cc:162
osl::misc::BinaryElementReader::hasNext
bool hasNext() const
Definition binaryIO.cc:151
osl::misc::BinaryElementReader::state
std::unique_ptr< State > state
Definition binaryIO.h:44
osl::misc::BinaryElementReader::failed
bool failed() const
Definition binaryIO.cc:157
osl::misc::BinaryElementReader::~BinaryElementReader
~BinaryElementReader()
Definition binaryIO.cc:146
osl::misc::BinaryReader::~BinaryReader
~BinaryReader()
Definition binaryIO.cc:60
osl::misc::BinaryReader::state
std::unique_ptr< State > state
Definition binaryIO.h:29
osl::misc::BinaryReader::blockSize
static size_t blockSize()
Definition binaryIO.cc:96
osl::misc::BinaryReader::BinaryReader
BinaryReader(std::istream &is)
Definition binaryIO.cc:55
osl::misc::BinaryReader::read
bool read(std::vector< T > &data)
Definition binaryIO.cc:90
osl::misc
Definition basic_type.h:66
osl
Definition additionalEffect.h:6
osl::misc::BinaryElementReader::State
Definition binaryIO.cc:104
osl::misc::BinaryReader::State
Definition binaryIO.cc:66
osl::misc::BinaryWriter
Definition binaryIO.h:14
osl::misc::BinaryWriter::write
static void write(std::ostream &, const std::vector< int > &data)
Definition binaryIO.cc:43