From cfcdd1a3f956f067ed20d3a5a77209c3f0f26879 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Sat, 18 May 2019 18:20:54 -0700 Subject: [PATCH] deprecate ByteBuffer::getArray() in favor of identical ByteBuffer::getBuffer() --- src/misc/pv/byteBuffer.h | 3 ++- src/misc/serializeHelper.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/misc/pv/byteBuffer.h b/src/misc/pv/byteBuffer.h index 0d777c0..ab96ca9 100644 --- a/src/misc/pv/byteBuffer.h +++ b/src/misc/pv/byteBuffer.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -695,7 +696,7 @@ public: EPICS_ALWAYS_INLINE double getDouble (std::size_t index) { return get(index); } // TODO remove - EPICS_ALWAYS_INLINE const char* getArray() const + EPICS_ALWAYS_INLINE const char* getArray() const EPICS_DEPRECATED { return _buffer; } diff --git a/src/misc/serializeHelper.cpp b/src/misc/serializeHelper.cpp index f105afb..54e3f7e 100644 --- a/src/misc/serializeHelper.cpp +++ b/src/misc/serializeHelper.cpp @@ -109,7 +109,7 @@ namespace epics { { // entire string is in buffer, simply create a string out of it (copy) std::size_t pos = buffer->getPosition(); - string str(buffer->getArray()+pos, size); + string str(buffer->getBuffer()+pos, size); buffer->setPosition(pos+size); return str; } @@ -122,7 +122,7 @@ namespace epics { while(true) { std::size_t toRead = min(size-i, buffer->getRemaining()); std::size_t pos = buffer->getPosition(); - str.append(buffer->getArray()+pos, toRead); + str.append(buffer->getBuffer()+pos, toRead); buffer->setPosition(pos+toRead); i += toRead; if(i