126 ostream::fmtflags old = s.flags();
128 for (
int i = m.
start; i < m.
len; i++)
129 s << hex << setw(2) << setfill(
'0') << (int)m.
buff[i] <<
" ";
135 for (
int i = m.
start; i < m.
len; i++) {
136 unsigned char c = m.
buff[i];
137 s << (
unsigned char)(isprint(
c) ?
c :
'.');
185 if ((maxLen >= 0) && (maxLen < l))
223 buff[1] = (
a>>8) & 0xff;
ostream & operator<<(std::ostream &s, const bufferStore &m)
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.
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.