Insert a moved buffer at an index in dest if size limits allow.
Synopsis
Declared in <bdlbb_blobutil.h>
static
int
insertBufferIfValid(
Blob* dest,
int index,
bslmf::MovableRef<BlobBuffer> buffer);
Description
Insert the specified move‐insertable buffer at the specified index in the specified dest if 0 <= index <= dest‐>numBuffers() and 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. Increment the length of the 'dest by the size of the buffer if buffer is inserted before the logical end of the dest. The length of the dest is unchanged if inserting at a position following all data buffers (e.g., inserting into an empty blob or inserting a buffer to increase capacity); in that case, the blob length must be changed by an explicit call to setLength. Buffers at index and higher positions (if any) are shifted up by one index position. In case of success the buffer is left in a valid but unspecified state.
Return Value
0 on success, and a non‐zero value otherwise
Parameters
Name |
Description |
dest |
destination blob |
index |
buffer index at which to insert |
buffer |
buffer to move‐insert |
Created with MrDocs