Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# OSCL_HeapString< Alloc > Class Template Reference
[OSCL Util]

`#include <oscl_string_containers.h>`

Inheritance diagram for OSCL_HeapString< Alloc >:

## Public Types
typedef OSCL_String::chartype | chartype
typedef TOSCL_StringOp | optype
typedef OSCL_wString::chartype | other_chartype
## Public Methods
| OSCL_HeapString ()
| OSCL_HeapString (const OSCL_HeapString &src)
| OSCL_HeapString (const OSCL_String &src)
| OSCL_HeapString (const chartype *cstr)
| OSCL_HeapString (const chartype *buf, uint32 length)
| ~OSCL_HeapString ()
uint32 | get_size () const
uint32 | get_maxsize () const
const chartype * | get_cstr () const
chartype * | get_str () const
OSCL_HeapString & | operator= (const OSCL_HeapString &src)
OSCL_HeapString & | operator= (const OSCL_String &src)
OSCL_HeapString & | operator= (const chartype *cstr)
void | set (const chartype *buf, uint32 length)
void | set (const other_chartype *buf, optype op)
void | set (const other_chartype *buf, uint32 length, optype op)
## Friends
class | OSCL_String

## Detailed Description

### template<class Alloc>
class OSCL_HeapString< Alloc >

OSCL_HeapString is a simple string class, compatible with regular character array strings.

The string array is variable length, is allocated from the heap, and is modifiable. A copy-on-write mechanism is used to minimize unnecessary copying when multiple instances of a string are created for reading. Allocated memory is automatically freed by the class destructor when the last string referencing the memory is destroyed.

The class HAS NO thread synchronization built-in, so it is NOT MT-SAFE. External locks should be used if the class is to be shared across threads.

Parameters:

  Alloc: | memory allocator, derived from Oscl_DefAlloc.

## Member Typedef Documentation

template<class Alloc>
typedef OSCL_String::chartype OSCL_HeapString< Alloc >::chartype

| Reimplemented from OSCL_String.

template<class Alloc>
typedef TOSCL_StringOp OSCL_HeapString< Alloc >::optype

template<class Alloc>
typedef OSCL_wString::chartype OSCL_HeapString< Alloc >::other_chartype

## Friends And Related Function Documentation

template<class Alloc>
friend class OSCL_String`[friend]`

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

- oscl_string_containers.h