[#BloombergLP-bdlbb-BlobUtil-insertBufferIfValid-0f] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlbb.adoc[bdlbb]::xref:BloombergLP/bdlbb/BlobUtil.adoc[BlobUtil]::insertBufferIfValid :relfileprefix: ../../../ :mrdocs: `insertBufferIfValid` overloads == Synopses Declared in `<bdlbb_blobutil.h>` 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 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlbb/BlobUtil/insertBufferIfValid-08.adoc[insertBufferIfValid]( xref:BloombergLP/bdlbb/Blob.adoc[Blob]* dest, int index, xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<BlobBuffer>] buffer); ---- [.small]#xref:BloombergLP/bdlbb/BlobUtil/insertBufferIfValid-08.adoc[_» more..._]# Insert the specified `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 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int xref:BloombergLP/bdlbb/BlobUtil/insertBufferIfValid-0b.adoc[insertBufferIfValid]( xref:BloombergLP/bdlbb/Blob.adoc[Blob]* dest, int index, xref:BloombergLP/bdlbb/BlobBuffer.adoc[BlobBuffer] const& buffer); ---- [.small]#xref:BloombergLP/bdlbb/BlobUtil/insertBufferIfValid-0b.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#