ICU 64.2  64.2
Public Member Functions
icu::StringByteSink< StringClass > Class Template Reference

Implementation of ByteSink that writes to a "string". More...

#include <bytestream.h>

Inheritance diagram for icu::StringByteSink< StringClass >:
icu::ByteSink icu::UMemory

Public Member Functions

 StringByteSink (StringClass *dest)
 Constructs a ByteSink that will append bytes to the dest string. More...
 
 StringByteSink (StringClass *dest, int32_t initialAppendCapacity)
 Constructs a ByteSink that reserves append capacity and will append bytes to the dest string. More...
 
virtual void Append (const char *data, int32_t n)
 Append "bytes[0,n-1]" to this. More...
 
- Public Member Functions inherited from icu::ByteSink
 ByteSink ()
 Default constructor. More...
 
virtual ~ByteSink ()
 Virtual destructor. More...
 
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. More...
 
virtual void Flush ()
 Flush internal buffers. More...
 

Detailed Description

template<typename StringClass>
class icu::StringByteSink< StringClass >

Implementation of ByteSink that writes to a "string".

The StringClass is usually instantiated with a std::string.

Stable:
ICU 4.2

Definition at line 232 of file bytestream.h.

Constructor & Destructor Documentation

◆ StringByteSink() [1/2]

template<typename StringClass>
icu::StringByteSink< StringClass >::StringByteSink ( StringClass *  dest)
inline

Constructs a ByteSink that will append bytes to the dest string.

Parameters
destpointer to string object to append to
Stable:
ICU 4.2

Definition at line 239 of file bytestream.h.

◆ StringByteSink() [2/2]

template<typename StringClass>
icu::StringByteSink< StringClass >::StringByteSink ( StringClass *  dest,
int32_t  initialAppendCapacity 
)
inline

Constructs a ByteSink that reserves append capacity and will append bytes to the dest string.

Parameters
destpointer to string object to append to
initialAppendCapacitycapacity beyond dest->length() to be reserve()d
Stable:
ICU 60

Definition at line 247 of file bytestream.h.

Member Function Documentation

◆ Append()

template<typename StringClass>
virtual void icu::StringByteSink< StringClass >::Append ( const char *  data,
int32_t  n 
)
inlinevirtual

Append "bytes[0,n-1]" to this.

Parameters
datathe pointer to the bytes
nthe number of bytes; must be non-negative
Stable:
ICU 4.2

Implements icu::ByteSink.

Definition at line 259 of file bytestream.h.

References U_NAMESPACE_END.


The documentation for this class was generated from the following file: