aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-13 12:19:10 +0200
committerStefan Boberg <[email protected]>2021-09-13 12:19:10 +0200
commit4d43557de2bdb6bbba7a1378f3f83b3e58bcd843 (patch)
tree0eb26de57395d424fede42d86a3b11b66b4f3baf
parentPackage filtering related test code (diff)
downloadzen-4d43557de2bdb6bbba7a1378f3f83b3e58bcd843.tar.xz
zen-4d43557de2bdb6bbba7a1378f3f83b3e58bcd843.zip
Changed CbPackage::TryLoad() signature so it can handle temporaries
-rw-r--r--zencore/compactbinarypackage.cpp2
-rw-r--r--zencore/include/zencore/compactbinarypackage.h4
2 files changed, 2 insertions, 4 deletions
diff --git a/zencore/compactbinarypackage.cpp b/zencore/compactbinarypackage.cpp
index a345f2b1b..9b41fd3db 100644
--- a/zencore/compactbinarypackage.cpp
+++ b/zencore/compactbinarypackage.cpp
@@ -428,7 +428,7 @@ CbPackage::GatherAttachments(const CbObject& Value, AttachmentResolver Resolver)
}
bool
-CbPackage::TryLoad(IoBuffer& InBuffer, BufferAllocator Allocator, AttachmentResolver* Mapper)
+CbPackage::TryLoad(IoBuffer InBuffer, BufferAllocator Allocator, AttachmentResolver* Mapper)
{
MemoryInStream InStream(InBuffer.Data(), InBuffer.Size());
BinaryReader Reader(InStream);
diff --git a/zencore/include/zencore/compactbinarypackage.h b/zencore/include/zencore/compactbinarypackage.h
index 57624a3ab..c6bb32def 100644
--- a/zencore/include/zencore/compactbinarypackage.h
+++ b/zencore/include/zencore/compactbinarypackage.h
@@ -317,9 +317,7 @@ public:
* The iterator is advanced as object and attachment fields are consumed from it.
*/
ZENCORE_API bool TryLoad(CbFieldIterator& Fields);
-
- ZENCORE_API bool TryLoad(IoBuffer& Buffer, BufferAllocator Allocator = UniqueBuffer::Alloc, AttachmentResolver* Mapper = nullptr);
-
+ ZENCORE_API bool TryLoad(IoBuffer Buffer, BufferAllocator Allocator = UniqueBuffer::Alloc, AttachmentResolver* Mapper = nullptr);
ZENCORE_API bool TryLoad(BinaryReader& Reader, BufferAllocator Allocator = UniqueBuffer::Alloc, AttachmentResolver* Mapper = nullptr);
/** Save the object and attachments into the writer as a stream of compact binary fields. */