aboutsummaryrefslogtreecommitdiff
path: root/ByteBuffer.h
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-02-20 17:53:33 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-02-20 17:53:33 +0100
commit71167b3c8fb1ce47feb72b9376b899e40ffd3907 (patch)
treeb0ddcc52312e6f673d571aacd6136d0a6121d265 /ByteBuffer.h
parented2ec4bb64052d3ed8d2357abdc080aea4341811 (diff)
downloadble-toys-71167b3c8fb1ce47feb72b9376b899e40ffd3907.tar.gz
ble-toys-71167b3c8fb1ce47feb72b9376b899e40ffd3907.tar.bz2
ble-toys-71167b3c8fb1ce47feb72b9376b899e40ffd3907.tar.xz
ble-toys-71167b3c8fb1ce47feb72b9376b899e40ffd3907.zip
wip
Diffstat (limited to 'ByteBuffer.h')
-rw-r--r--ByteBuffer.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/ByteBuffer.h b/ByteBuffer.h
index b3e06cf..3836966 100644
--- a/ByteBuffer.h
+++ b/ByteBuffer.h
@@ -17,14 +17,8 @@ public:
class ByteBuffer {
public:
- /**
- * Wrapping constructor, the size will be equal to the capacity.
- */
ByteBuffer(const std::shared_ptr<uint8_t> bytes, size_t capacity);
- /**
- * Wrapping constructor.
- */
ByteBuffer(const std::shared_ptr<uint8_t> bytes, size_t capacity, size_t zero, size_t size);
inline size_t getSize() const {
@@ -40,6 +34,10 @@ public:
return ptr - zero;
}
+ inline size_t getBytesLeft() const {
+ return end - ptr;
+ }
+
inline void setCursor(size_t newCursor) {
// assertCanAccessRelative(newCursor);
ptr = (uint8_t *) &zero[newCursor];