4#include <c++utilities/io/binaryreader.h>
5#include <c++utilities/io/binarywriter.h>
26 , m_tiedAccount(tiedAccount)
37 BinaryReader reader(&stream);
38 const int version = reader.readByte();
39 if (version != 0x0 && version != 0x1) {
42 m_name = reader.readLengthPrefixedString();
43 m_value = reader.readLengthPrefixedString();
44 std::uint8_t
type = reader.readByte();
51 const std::uint16_t extendedHeaderSize = reader.readUInt16BE();
63 BinaryWriter writer(&stream);
65 writer.writeLengthPrefixedString(m_name);
66 writer.writeLengthPrefixedString(m_value);
67 writer.writeByte(
static_cast<std::uint8_t
>(m_type));
69 writer.writeUInt16BE(
static_cast<std::uint16_t
>(
m_extendedData.size()));
The exception that is thrown when a parsing error occurs.
void make(std::ostream &stream) const
Serializes the current instance to the specified stream.
static bool isValidType(int number)
Returns whether the specified number is a valid field type.
FieldType type() const
Returns the type.
AccountEntry * tiedAccount() const
Returns the tied account.
std::string m_extendedData
The exception that is thrown when a parsing error occurs.
Contains all IO related classes.