Add Buffer::copy_from(GWBUF*)
This makes it easier to create a Buffer from GWBUF that the API functions pass as arguments.
This commit is contained in:
parent
f06b2b5ab9
commit
23aa9cc492
@ -423,9 +423,22 @@ public:
|
||||
* @see Buffer::operator =
|
||||
*/
|
||||
bool copy_from(const Buffer& rhs)
|
||||
{
|
||||
return copy_from(rhs.m_pBuffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone a GWBUF and free the current buffer
|
||||
*
|
||||
* @param buf Buffer to clone
|
||||
*
|
||||
* @return True if buffer was copied
|
||||
*
|
||||
* @attention Invalidates all iterators.
|
||||
*/
|
||||
bool copy_from(GWBUF* pBuffer)
|
||||
{
|
||||
bool copied = true;
|
||||
GWBUF* pBuffer = rhs.m_pBuffer;
|
||||
|
||||
if (pBuffer)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user