124 ostream::fmtflags old = s.flags();
126 for (
int i = m.
start; i < m.
len; i++)
127 s << hex << setw(2) << setfill(
'0') << (int)m.
buff[i] <<
" ";
133 for (
int i = m.
start; i < m.
len; i++) {
134 unsigned char c = m.
buff[i];
135 s << (
unsigned char)(isprint(
c) ?
c :
'.');
183 if ((maxLen >= 0) && (maxLen < l))
222 buff[1] = (
a>>8) & 0xff;
ostream & operator<<(std::ostream &s, const BufferStore &m)
A generic container for an array of bytes.
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.
uint16_t getWord(long pos=0) const
Retrieves the word at index pos.
~BufferStore()
Destroys a BufferStore instance.
uint32_t getDWord(long pos=0) const
Retrieves the dword at index pos.
void truncate(long newLen)
Truncates the buffer.
void prependWord(int w)
Prepends a word to the content of this instance.
void addByte(unsigned char c)
Appends a byte to the content of this instance.
void addWord(int w)
Appends a word to the content of this instance.
void addBuff(const BufferStore &b, long maxLen=-1)
Appends data to the content of this instance.
void addStringT(const char *s)
Appends a string to the content of this instance.
void addDWord(long dw)
Appends a dword to the content of this instance.
unsigned long getLen() const
Retrieves the length of a BufferStore.
BufferStore()
Constructs a new BufferStore.
void checkAllocd(long newLen)
unsigned char getByte(long pos=0) const
Retrieves the byte at index pos.
void addBytes(const unsigned char *buf, int len)
Appends data to the content of this instance.
BufferStore & operator=(const BufferStore &)
Copies a BufferStore.
void addString(const char *s)
Appends a string to the content of this instance.
int32_t getSDWord(long pos=0) const
Retrieves the signed dword at index pos.
void discardFirstBytes(int len=0)
Removes bytes from the start of the buffer.
void init()
Initializes the BufferStore.