summaryrefslogtreecommitdiffstats
path: root/src/ByteBuffer.h
diff options
context:
space:
mode:
authorTycho Bickerstaff <work.tycho@gmail.com>2013-12-11 00:01:35 +0100
committerTycho Bickerstaff <work.tycho@gmail.com>2013-12-11 00:01:35 +0100
commitdd633d5a947771cd37f8a853ceb44660752a7e3c (patch)
tree0141233cb7025eaca681513b6670b325c76f57c1 /src/ByteBuffer.h
parentadded tolua++ command and removed stackwalker from build (diff)
parentMerge branch 'master' of https://github.com/mc-server/MCServer (diff)
downloadcuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.gz
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.bz2
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.lz
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.xz
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.zst
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.zip
Diffstat (limited to 'src/ByteBuffer.h')
-rw-r--r--src/ByteBuffer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ByteBuffer.h b/src/ByteBuffer.h
index 95c690203..06c846fa9 100644
--- a/src/ByteBuffer.h
+++ b/src/ByteBuffer.h
@@ -42,6 +42,9 @@ public:
/// Returns the number of bytes that are currently available for reading (may be less than UsedSpace due to some data having been read already)
int GetReadableSpace(void) const;
+ /// Returns the current data start index. For debugging purposes.
+ int GetDataStart(void) const { return m_DataStart; }
+
/// Returns true if the specified amount of bytes are available for reading
bool CanReadBytes(int a_Count) const;
@@ -106,6 +109,9 @@ public:
/// Reads all available data into a_Data
void ReadAll(AString & a_Data);
+ /// Reads the specified number of bytes and writes it into the destinatio bytebuffer. Returns true on success.
+ bool ReadToByteBuffer(cByteBuffer & a_Dst, int a_NumBytes);
+
/// Removes the bytes that have been read from the ringbuffer
void CommitRead(void);