Ark Server API (ASE) - Wiki
|
#include <BinaryReader.h>
Public Types | |
enum | StreamByteOrder { NATIVE_BYTE_ORDER = 1 , BIG_ENDIAN_BYTE_ORDER = 2 , NETWORK_BYTE_ORDER = 2 , LITTLE_ENDIAN_BYTE_ORDER = 3 , UNSPECIFIED_BYTE_ORDER = 4 } |
Public Member Functions | |
BinaryReader (std::istream &istr, StreamByteOrder byteOrder=NATIVE_BYTE_ORDER) | |
BinaryReader (std::istream &istr, TextEncoding &encoding, StreamByteOrder byteOrder=NATIVE_BYTE_ORDER) | |
Creates the BinaryReader. | |
~BinaryReader () | |
BinaryReader & | operator>> (bool &value) |
Destroys the BinaryReader. | |
BinaryReader & | operator>> (char &value) |
BinaryReader & | operator>> (unsigned char &value) |
BinaryReader & | operator>> (signed char &value) |
BinaryReader & | operator>> (short &value) |
BinaryReader & | operator>> (unsigned short &value) |
BinaryReader & | operator>> (int &value) |
BinaryReader & | operator>> (unsigned int &value) |
BinaryReader & | operator>> (long &value) |
BinaryReader & | operator>> (unsigned long &value) |
BinaryReader & | operator>> (float &value) |
BinaryReader & | operator>> (double &value) |
BinaryReader & | operator>> (std::string &value) |
template<typename T > | |
BinaryReader & | operator>> (std::vector< T > &value) |
void | read7BitEncoded (UInt32 &value) |
void | readRaw (std::streamsize length, std::string &value) |
void | readRaw (char *buffer, std::streamsize length) |
Reads length bytes of raw data into value. | |
void | readBOM () |
Reads length bytes of raw data into buffer. | |
bool | good () |
bool | fail () |
Returns _istr.good();. | |
bool | bad () |
Returns _istr.fail();. | |
bool | eof () |
Returns _istr.bad();. | |
std::istream & | stream () const |
Returns _istr.eof();. | |
StreamByteOrder | byteOrder () const |
Returns the underlying stream. | |
void | setExceptions (std::ios_base::iostate st=(std::istream::failbit|std::istream::badbit)) |
std::streamsize | available () const |
Sets the stream to throw exception on specified state (default failbit and badbit);. | |
Private Attributes | |
std::istream & | _istr |
Returns the number of available bytes in the stream. | |
bool | _flipBytes |
TextConverter * | _pTextConverter |
This class reads basic types (and std::vectors thereof) in binary form into an input stream. It provides an extractor-based interface similar to istream. The reader also supports automatic conversion from big-endian (network byte order) to little-endian and vice-versa. Use a BinaryWriter to create a stream suitable for a BinaryReader.
Definition at line 35 of file BinaryReader.h.
Definition at line 44 of file BinaryReader.h.
Poco::BinaryReader::BinaryReader | ( | std::istream & | istr, |
StreamByteOrder | byteOrder = NATIVE_BYTE_ORDER ) |
Poco::BinaryReader::BinaryReader | ( | std::istream & | istr, |
TextEncoding & | encoding, | ||
StreamByteOrder | byteOrder = NATIVE_BYTE_ORDER ) |
Creates the BinaryReader.
Poco::BinaryReader::~BinaryReader | ( | ) |
Creates the BinaryReader using the given TextEncoding.
Strings will be converted from the specified encoding to the currently set global encoding (see Poco::TextEncoding::global()).
|
inline |
Sets the stream to throw exception on specified state (default failbit and badbit);.
Definition at line 256 of file BinaryReader.h.
|
inline |
Returns _istr.fail();.
Definition at line 222 of file BinaryReader.h.
|
inline |
Returns the underlying stream.
Definition at line 240 of file BinaryReader.h.
|
inline |
Returns _istr.bad();.
Definition at line 228 of file BinaryReader.h.
|
inline |
Returns _istr.good();.
Definition at line 216 of file BinaryReader.h.
|
inline |
Reads a byte-order mark from the stream and configures the reader for the encountered byte order. A byte-order mark is a 16-bit integer with a value of 0xFEFF, written in host byte order.
Definition at line 210 of file BinaryReader.h.
BinaryReader & Poco::BinaryReader::operator>> | ( | bool & | value | ) |
Destroys the BinaryReader.
BinaryReader & Poco::BinaryReader::operator>> | ( | char & | value | ) |
BinaryReader & Poco::BinaryReader::operator>> | ( | double & | value | ) |
BinaryReader & Poco::BinaryReader::operator>> | ( | float & | value | ) |
BinaryReader & Poco::BinaryReader::operator>> | ( | int & | value | ) |
BinaryReader & Poco::BinaryReader::operator>> | ( | long & | value | ) |
BinaryReader & Poco::BinaryReader::operator>> | ( | short & | value | ) |
BinaryReader & Poco::BinaryReader::operator>> | ( | signed char & | value | ) |
BinaryReader & Poco::BinaryReader::operator>> | ( | std::string & | value | ) |
|
inline |
Definition at line 86 of file BinaryReader.h.
BinaryReader & Poco::BinaryReader::operator>> | ( | unsigned char & | value | ) |
BinaryReader & Poco::BinaryReader::operator>> | ( | unsigned int & | value | ) |
BinaryReader & Poco::BinaryReader::operator>> | ( | unsigned long & | value | ) |
BinaryReader & Poco::BinaryReader::operator>> | ( | unsigned short & | value | ) |
void Poco::BinaryReader::read7BitEncoded | ( | UInt32 & | value | ) |
void Poco::BinaryReader::readBOM | ( | ) |
Reads length bytes of raw data into buffer.
void Poco::BinaryReader::readRaw | ( | char * | buffer, |
std::streamsize | length ) |
Reads length bytes of raw data into value.
void Poco::BinaryReader::readRaw | ( | std::streamsize | length, |
std::string & | value ) |
Reads a 32-bit unsigned integer in compressed format. See BinaryWriter::write7BitEncoded() for a description of the compression algorithm.
|
inline |
Returns the byte-order used by the reader, which is either BIG_ENDIAN_BYTE_ORDER or LITTLE_ENDIAN_BYTE_ORDER.
Definition at line 250 of file BinaryReader.h.
|
inline |
Returns _istr.eof();.
Definition at line 234 of file BinaryReader.h.
|
private |
Definition at line 153 of file BinaryReader.h.
|
private |
Returns the number of available bytes in the stream.
Definition at line 152 of file BinaryReader.h.
|
private |
Definition at line 154 of file BinaryReader.h.