Sets the data length of this instance. Applications must make sure all data of the specified length has been initialized before adding a CordBuffer to a Cord: failure to do so will lead to undefined behavior. Setting the length to a small value or zero does not release any memory held by this CordBuffer instance. Requires length <= capacity(). Applications should preferably use the IncreaseLengthBy() method above in combination with the 'available()` or `available_up_to()` methods.
Synopsis
Declared in <absl/strings/cord_buffer.h>
void
SetLength(size_t length);
Parameters
Name |
Description |
length |
The new length of the initialized data. |
Created with MrDocs