21#ifndef _BUFFERSTORE_H_
22#define _BUFFERSTORE_H_
77 unsigned long getLen()
const;
86 unsigned char getByte(
long pos = 0)
const;
95 uint16_t
getWord(
long pos = 0)
const;
104 uint32_t
getDWord(
long pos = 0)
const;
122 const char *
getString(
long pos = 0)
const;
163 void init(
const unsigned char * buf,
long len);
A generic container for an array of bytes.
void discardFirstBytes(int len=0)
Removes bytes from the start of the buffer.
void init()
Initializes the bufferStore.
uint16_t getWord(long pos=0) const
Retrieves the word at index pos.
void addBuff(const bufferStore &b, long maxLen=-1)
Appends data to the content of this instance.
void checkAllocd(long newLen)
bufferStore()
Constructs a new bufferStore.
void addByte(unsigned char c)
Appends a byte to the content of this instance.
void addBytes(const unsigned char *buf, int len)
Appends data to the content of this instance.
const char * getString(long pos=0) const
Retrieves the characters at index pos.
void prependByte(unsigned char c)
Prepends a byte to the content of this instance.
void prependWord(int w)
Prepends a word to the content of this instance.
bufferStore & operator=(const bufferStore &)
Copies a bufferStore.
bool empty() const
Tests if the bufferStore is empty.
void addDWord(long dw)
Appends a dword to the content of this instance.
void addStringT(const char *s)
Appends a string to the content of this instance.
void truncate(long newLen)
Truncates the buffer.
void addWord(int w)
Appends a word to the content of this instance.
unsigned long getLen() const
Retrieves the length of a bufferStore.
~bufferStore()
Destroys a bufferStore instance.
void addString(const char *s)
Appends a string to the content of this instance.
uint32_t getDWord(long pos=0) const
Retrieves the dword at index pos.
unsigned char getByte(long pos=0) const
Retrieves the byte at index pos.
int32_t getSDWord(long pos=0) const
Retrieves the signed dword at index pos.
friend std::ostream & operator<<(std::ostream &s, const bufferStore &m)
Prints a dump of the content.