ICU 76.1 76.1
|
Implementation of ByteSink that writes to a "string". More...
#include <bytestream.h>
Public Member Functions | |
StringByteSink (StringClass *dest) | |
Constructs a ByteSink that will append bytes to the dest string. | |
StringByteSink (StringClass *dest, int32_t initialAppendCapacity) | |
Constructs a ByteSink that reserves append capacity and will append bytes to the dest string. | |
virtual void | Append (const char *data, int32_t n) override |
Append "bytes[0,n-1]" to this. | |
Public Member Functions inherited from icu::ByteSink | |
ByteSink () | |
Default constructor. | |
virtual | ~ByteSink () |
Virtual destructor. | |
void | AppendU8 (const char *bytes, int32_t n) |
Appends n bytes to this. | |
void | AppendU8 (const char8_t *bytes, int32_t n) |
Appends n bytes to this. | |
virtual char * | GetAppendBuffer (int32_t min_capacity, int32_t desired_capacity_hint, char *scratch, int32_t scratch_capacity, int32_t *result_capacity) |
Returns a writable buffer for appending and writes the buffer's capacity to *result_capacity. | |
virtual void | Flush () |
Flush internal buffers. | |
Implementation of ByteSink that writes to a "string".
The StringClass is usually instantiated with a std::string.
Definition at line 267 of file bytestream.h.
|
inline |
Constructs a ByteSink that will append bytes to the dest string.
dest | pointer to string object to append to |
Definition at line 274 of file bytestream.h.
|
inline |
Constructs a ByteSink that reserves append capacity and will append bytes to the dest string.
dest | pointer to string object to append to |
initialAppendCapacity | capacity beyond dest->length() to be reserve()d |
Definition at line 282 of file bytestream.h.
|
inlineoverridevirtual |
Append "bytes[0,n-1]" to this.
data | the pointer to the bytes |
n | the number of bytes; must be non-negative |
Implements icu::ByteSink.
Definition at line 294 of file bytestream.h.