1
#ifndef OB_IO_BINARY_INCLUDED
2
#define OB_IO_BINARY_INCLUDED
5
#pragma warning (disable : 4786)
21
/* generic binary readers for basic data types */
22
unsigned int OB_io_read_binary(char *ccc, char *x, unsigned int size, unsigned int count);
23
unsigned int OB_io_read_binary(istream &, char *x, unsigned int size, unsigned int count);
25
/* generic binary writers for basic data types */
26
unsigned int OB_io_write_binary(char *ccc, const char *x, unsigned int size, unsigned int count);
27
unsigned int OB_io_write_binary(ostream &, const char *x, unsigned int size, unsigned int count);
29
/* binary readers for STL strings */
30
unsigned int OB_io_read_binary(char* ccc, string& str);
31
unsigned int OB_io_read_binary(istream& ifs, string& str);
33
/* binary writers for STL strings */
34
unsigned int OB_io_write_binary(char* ccc, const string& str);
35
unsigned int OB_io_write_binary(ostream& ofs, const string& str);
37
/* binary writers for compressed data */
38
unsigned int OB_io_write_binary_compressed(char*ccc, unsigned int *x, unsigned int bits, unsigned int Nvalues); //Writes 1+(bits*Nvalues)/8 bytes
39
unsigned int OB_io_write_binary_compressed(ostream&, unsigned int *x, unsigned int bits, unsigned int Nvalues); //Writes 1+(bits*Nvalues)/8 bytes
40
unsigned int OB_io_write_binary_compressed(char*ccc, float *x, unsigned int bits, unsigned int Nvalues); //Writes 9+(bits*Nvalues)/8 bytes
41
unsigned int OB_io_write_binary_compressed(ostream&, float *x, unsigned int bits, unsigned int Nvalues); //Writes 9+(bits*Nvalues)/8 bytes
43
/* binary readers for compressed data */
44
unsigned int OB_io_read_binary_compressed(char*ccc, unsigned int *x, unsigned int bits, unsigned int Nvalues); //Reads 1+(bits*Nvalues)/8 bytes
45
unsigned int OB_io_read_binary_compressed(istream&, unsigned int *x, unsigned int bits, unsigned int Nvalues); //Reads 1+(bits*Nvalues)/8 bytes
46
unsigned int OB_io_read_binary_compressed(char*ccc, float *x, unsigned int bits, unsigned int Nvalues); //Reads 9+(bits*Nvalues)/8 bytes
47
unsigned int OB_io_read_binary_compressed(istream&, float *x, unsigned int bits, unsigned int Nvalues); //Reads 9+(bits*Nvalues)/8 bytes
49
/* utilities for reading/writing compressed data */
50
unsigned int OB_io_util_calc_NumBits(unsigned int *x, unsigned int N);
51
unsigned int OB_io_util_calc_NumBits(float *x, unsigned int N, float res);
54
**\brief An abstract base class with binary read and write function.
55
**Members of this class understand how to read and write themselves
56
**to and from platform independent binary streams and arrays using
57
**the functions of this class.
61
virtual ~OBBinaryIO() {}
62
virtual unsigned int WriteBinary(char *ccc) const = 0;
63
virtual unsigned int ReadBinary(char *ccc) = 0;
64
virtual unsigned int WriteBinary(ostream& ostr) const = 0;
65
virtual unsigned int ReadBinary(istream& istr) = 0;
66
virtual unsigned int BinarySize() const = 0;
70
**\brief Writes a OBBinaryIO object to a file stream, preappending
71
**the record with the size of the OBBinaryIO objects binary record.
73
ostream& operator<<(ostream& ostr, const OBBinaryIO& obj);
76
**\brief Reads in a OBBinaryIO object that has the size of the
77
**binary record preappended to the record.
79
istream& operator>>(istream& istr, OBBinaryIO& obj);
81
}//End namespace OpenBabel