aboutsummaryrefslogtreecommitdiff
path: root/zencore/stream.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2022-02-21 15:14:11 +0100
committerPer Larsson <[email protected]>2022-02-21 15:14:11 +0100
commitdb1c9605e3afbaf86f4231ba4eb7976d896f286b (patch)
tree54b451da4247c69575ff1a05ed006ecef3905c85 /zencore/stream.cpp
parentIf open(O_CREAT) is used then a file mode must be given (diff)
parentRemoved optional offset for GetView. (diff)
downloadzen-db1c9605e3afbaf86f4231ba4eb7976d896f286b.tar.xz
zen-db1c9605e3afbaf86f4231ba4eb7976d896f286b.zip
Initial support for websockets.
Diffstat (limited to 'zencore/stream.cpp')
-rw-r--r--zencore/stream.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/zencore/stream.cpp b/zencore/stream.cpp
index aa9705764..8faf90af2 100644
--- a/zencore/stream.cpp
+++ b/zencore/stream.cpp
@@ -25,6 +25,15 @@ BinaryWriter::Write(const void* data, size_t ByteCount, uint64_t Offset)
memcpy(m_Buffer.data() + Offset, data, ByteCount);
}
+void
+BinaryWriter::Reset()
+{
+ RwLock::ExclusiveLockScope _(m_Lock);
+
+ m_Buffer.clear();
+ m_Offset = 0;
+}
+
//////////////////////////////////////////////////////////////////////////
//
// Testing related code follows...