deprecate ByteBuffer::getArray()

in favor of identical ByteBuffer::getBuffer()
This commit is contained in:
Michael Davidsaver
2019-05-18 18:20:54 -07:00
parent 95ff606ba1
commit cfcdd1a3f9
2 changed files with 4 additions and 3 deletions

View File

@@ -16,6 +16,7 @@
#include <epicsEndian.h>
#include <shareLib.h>
#include <epicsAssert.h>
#include <compilerDependencies.h>
#include <pv/templateMeta.h>
#include <pv/pvType.h>
@@ -695,7 +696,7 @@ public:
EPICS_ALWAYS_INLINE double getDouble (std::size_t index) { return get<double>(index); }
// TODO remove
EPICS_ALWAYS_INLINE const char* getArray() const
EPICS_ALWAYS_INLINE const char* getArray() const EPICS_DEPRECATED
{
return _buffer;
}

View File

@@ -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<size)