summaryrefslogtreecommitdiff
path: root/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.h')
-rw-r--r--buffer.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/buffer.h b/buffer.h
index 1218809..bfba94a 100644
--- a/buffer.h
+++ b/buffer.h
@@ -167,6 +167,31 @@ public:
// In case the buffer was too small, skip over the extra source data
m_readPointer += (size - readAmount);
}
+
+
+ void dump() {
+ for (int base = 0; base < m_size; base += 0x10) {
+ printf("%08x | ", base);
+
+ int pos;
+ for (pos = base; (pos < m_size) && (pos < (base + 0x10)); pos++)
+ printf("%02x ", (uint8_t)m_data[pos]);
+
+ if (pos < (base + 0x10))
+ for (; pos < (base + 0x10); pos++)
+ printf(" ");
+
+ printf("| ");
+
+ for (pos = base; (pos < m_size) && (pos < (base + 0x10)); pos++)
+ if (m_data[pos] >= 32)
+ printf("%c", m_data[pos]);
+ else
+ printf(".");
+
+ printf("\n");
+ }
+ }
};
#endif /* BUFFER_H */