BloombergLP::bdlbb::BlobUtil::appendDataBufferIfValid

Append a data buffer to dest if size limits allow.

Synopsis

Declared in <bdlbb_blobutil.h>

static
int
appendDataBufferIfValid(
    Blob* dest,
    BlobBuffer const& buffer);

Description

Append the specified buffer after the last data buffer of the specified dest if neither the resulting total size of dest nor its resulting total number of buffers exceeds INT_MAX. Return 0 on success, and a non-zero value (with no effect) otherwise. The last data buffer of the dest is trimmed, if necessary. The length of the dest is incremented by the size of buffer.

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
destdestination blob
bufferdata buffer to append