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

# OSCL_String Class Reference
[OSCL Util]

`#include <oscl_string.h>`

Inheritance diagram for OSCL_String:

## Public Types
typedef char | chartype
## Public Methods
virtual uint32 | get_size () const=0
virtual uint32 | get_maxsize () const=0
virtual const chartype * | get_cstr () const=0
virtual bool | is_writable () const
virtual chartype * | get_str () const=0
OSCL_String & | operator= (const OSCL_String &src)
OSCL_String & | operator= (const chartype *cstr)
OSCL_String & | operator+= (const OSCL_String &src)
OSCL_String & | operator+= (const chartype *cstr)
OSCL_String & | operator+= (const chartype c)
bool | operator== (const OSCL_String &src) const
bool | operator!= (const OSCL_String &src) const
bool | operator< (const OSCL_String &src) const
bool | operator<= (const OSCL_String &src) const
bool | operator> (const OSCL_String &src) const
bool | operator>= (const OSCL_String &src) const
bool | operator== (const chartype *cstr) const
chartype | operator[] (uint32 index) const
virtual chartype | read (uint32 index) const
virtual uint32 | setrep_to_char (const oscl_wchar *src, uint32 len, TOSCL_StringOp op, Oscl_DefAlloc *aAlloc)
virtual int8 | hash () const
virtual void | write (uint32 index, chartype c)
virtual void | write (uint32 offset, uint32 length, const chartype *buf)
## Protected Methods
| OSCL_String ()
virtual | ~OSCL_String ()
virtual void | set_rep (const chartype *cstr)=0
virtual void | append_rep (const chartype *cstr)=0
virtual void | set_rep (const OSCL_String &src)=0
virtual void | append_rep (const OSCL_String &src)=0
virtual void | set_len (uint32 len)=0

## Detailed Description

A common base class for string classes with "char" character format

## Member Typedef Documentation

typedef char OSCL_String::chartype

| Reimplemented in OSCL_HeapString< Alloc >, OSCL_HeapStringA, OSCL_StackString< MaxBufSize >, OSCL_FastString, and OSCL_HeapString< OsclMemAllocator >.

## Constructor & Destructor Documentation

OSCL_String::OSCL_String | ( |  | ) | `[protected]`

virtual OSCL_String::~OSCL_String | ( |  | ) | `[protected, virtual]`

## Member Function Documentation

virtual void OSCL_String::append_rep | ( | const OSCL_String & | src | ) | `[protected, pure virtual]`

| Append the input string to the current string. The string may be truncated to fit the available storage.

virtual void OSCL_String::append_rep | ( | const chartype * | cstr | ) | `[protected, pure virtual]`

| Append the input null-terminated string to the current string. The string may be truncated to fit the available storage.

virtual const chartype* OSCL_String::get_cstr | ( |  | ) | `[pure virtual]`

| This function returns the C-style string for read access. Implemented in OSCL_HeapString< Alloc >, OSCL_HeapStringA, OSCL_StackString< MaxBufSize >, OSCL_FastString, and OSCL_HeapString< OsclMemAllocator >.

virtual uint32 OSCL_String::get_maxsize | ( |  | ) | `[pure virtual]`

| This function returns the maximum available storage size, not including null terminator. The maximum size may be larger than the current string size. Implemented in OSCL_HeapString< Alloc >, OSCL_HeapStringA, OSCL_StackString< MaxBufSize >, OSCL_FastString, and OSCL_HeapString< OsclMemAllocator >.

virtual uint32 OSCL_String::get_size | ( |  | ) | `[pure virtual]`

| This function returns the string size not including the null-terminator. Implemented in OSCL_HeapString< Alloc >, OSCL_HeapStringA, OSCL_StackString< MaxBufSize >, OSCL_FastString, and OSCL_HeapString< OsclMemAllocator >.

virtual chartype* OSCL_String::get_str | ( |  | ) | `[pure virtual]`

| This function returns the C-style string for write access. If the string is not writable it returns NULL. Implemented in OSCL_HeapString< Alloc >, OSCL_HeapStringA, OSCL_StackString< MaxBufSize >, OSCL_FastString, and OSCL_HeapString< OsclMemAllocator >.

virtual int8 OSCL_String::hash | ( |  | ) | `[virtual]`

| This function performs a hash operation on the string. If the string is not writable, the function leaves.

virtual bool OSCL_String::is_writable | ( |  | ) | `[virtual]`

| This function returns true if the string is writable.

bool OSCL_String::operator!= | ( | const OSCL_String & | src | ) | const

OSCL_String& OSCL_String::operator+= | ( | const chartype | c | ) |

| Append operator. This operator appends the input character to this object. The string may be truncated to fit available storage.

OSCL_String& OSCL_String::operator+= | ( | const chartype * | cstr | ) |

| Append operator. This operator appends the input string to this object. The string may be truncated to fit available storage. am: null-terminated string

OSCL_String& OSCL_String::operator+= | ( | const OSCL_String & | src | ) |

| Append operator. This operator appends the input string to this object. The string may be truncated to fit available storage.

bool OSCL_String::operator< | ( | const OSCL_String & | src | ) | const

bool OSCL_String::operator<= | ( | const OSCL_String & | src | ) | const

OSCL_String& OSCL_String::operator= | ( | const chartype * | cstr | ) |

| Assignment operator am: null-terminated string Reimplemented in OSCL_HeapString< Alloc >, OSCL_HeapStringA, OSCL_StackString< MaxBufSize >, OSCL_FastString, and OSCL_HeapString< OsclMemAllocator >.

OSCL_String& OSCL_String::operator= | ( | const OSCL_String & | src | ) |

| Assignment operator Reimplemented in OSCL_HeapString< Alloc >, OSCL_HeapStringA, OSCL_StackString< MaxBufSize >, and OSCL_HeapString< OsclMemAllocator >.

bool OSCL_String::operator== | ( | const chartype * | cstr | ) | const

| Comparison operator am: null-terminated string

bool OSCL_String::operator== | ( | const OSCL_String & | src | ) | const

| Comparison operators

bool OSCL_String::operator> | ( | const OSCL_String & | src | ) | const

bool OSCL_String::operator>= | ( | const OSCL_String & | src | ) | const

chartype OSCL_String::operator[] | ( | uint32 | index | ) | const

| This is subscript notation to access a character at the given position. If the index is outside the current size range then the function leaves.

virtual chartype OSCL_String::read | ( | uint32 | index | ) | const`[virtual]`

| This function returns the character at the given position. If the index is outside the current size range then the function leaves.

virtual void OSCL_String::set_len | ( | uint32 | len | ) | `[protected, pure virtual]`

| Update the length of the string. This function will only be called when the string is writable.

virtual void OSCL_String::set_rep | ( | const OSCL_String & | src | ) | `[protected, pure virtual]`

| Set string representation to input string.

virtual void OSCL_String::set_rep | ( | const chartype * | cstr | ) | `[protected, pure virtual]`

| Set string representation to input null-terminated string.

virtual uint32 OSCL_String::setrep_to_char | ( | const oscl_wchar * | src,
|  | uint32 | len,
|  | TOSCL_StringOp | op,
|  | Oscl_DefAlloc * | aAlloc
| ) | `[virtual]`

  | This function allocates a temp storage for performing one of the following operations based on TOSCL_StringOp compress src string from oscl_wchar to utf8. convert src string from oscl_wchar to utf8. call parent set_rep() to copy resulting string. Parameters:
  src: | reference input string
  len: | length of string to operate on
  op: | type operation mentioned above
  aAlloc: | optional, memory allocator if available
Returns: length of compressed or converted string exclude terminated '\0'.

virtual void OSCL_String::write | ( | uint32 | offset,
|  | uint32 | length,
|  | const chartype * | buf
| ) | `[virtual]`

  | This function replaces characters at the specified offset within the current string. If the string is not writable, the function leaves. The characters may be truncted to fit the current storage. Parameters:
  offset: | the offset into the existing string buffer
  length: | number of characters to copy.
  ptr: | character buffer, not necessarily null-terminated.

virtual void OSCL_String::write | ( | uint32 | index,
|  | chartype | c
| ) | `[virtual]`

| This function stores a character at the specified position. If the string is not writable, the function leaves. If the index is outside the current size range then the function leaves.

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

- oscl_string.h