17 #include <shawn_config.h>
18 #include "_apps_enable_cmake.h"
45 StorageType::const_iterator
iter_;
69 Storage(
const unsigned char[],
int length=-1);
75 virtual unsigned int position()
const;
113 virtual void writePacket(
unsigned char* packet,
int length);
114 virtual void writePacket(
const std::vector<unsigned char> &packet);
119 StorageType::size_type
size()
const {
return store.size(); }
121 StorageType::const_iterator
begin()
const {
return store.begin(); }
122 StorageType::const_iterator
end()
const {
return store.end(); }
virtual void writePacket(unsigned char *packet, int length)
std::vector< unsigned char > StorageType
StorageType::const_iterator begin() const
virtual void writeFloat(float)
virtual unsigned char readChar()
virtual std::string readString()
virtual void writeString(const std::string &s)
virtual float readFloat()
virtual unsigned int position() const
virtual void writeInt(int)
StorageType::const_iterator end() const
virtual void writeDouble(double)
virtual int readUnsignedByte()
virtual void writeStringList(const std::vector< std::string > &s)
virtual void writeChar(unsigned char)
StorageType::const_iterator iter_
virtual void writeUnsignedByte(int)
StorageType::size_type size() const
virtual void writeDoubleList(const std::vector< double > &s)
unsigned char readCharUnsafe()
Read a byte without validity check.
std::string hexDump() const
Dump storage content as series of hex values.
void writeByEndianess(const unsigned char *begin, unsigned int size)
Write size elements of array begin according to endianess.
Storage()
Standard Constructor.
virtual void writeByte(int)
virtual void writeStorage(tcpip::Storage &store)
void readByEndianess(unsigned char *array, int size)
Read size elements into array according to endianess.
virtual std::vector< std::string > readStringList()
virtual void writeShort(int)
void checkReadSafe(unsigned int num) const
Check if the next num bytes can be read safely.
void init()
Used in constructors to initialize local variables.
virtual double readDouble()
Storage & operator=(const Storage &)=delete
Invalidated assignment operator.
virtual std::vector< double > readDoubleList()