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

OSCL_String Class Reference
[OSCL Util]

#include <oscl_string.h>

Inheritance diagram for OSCL_String:

HeapBase _OsclHeapBase OSCL_FastString OSCL_HeapString< Alloc > OSCL_HeapStringA OSCL_StackString< MaxBufSize >

Public Types

typedef char chartype

Public Methods

virtual uint32 get_size () const=0
virtual uint32 get_maxsize () const=0
virtual const chartypeget_cstr () const=0
virtual OSCL_IMPORT_REF bool is_writable () const
virtual chartypeget_str () const=0
OSCL_IMPORT_REF OSCL_String & operator= (const OSCL_String &src)
OSCL_IMPORT_REF OSCL_String & operator= (const chartype *cstr)
OSCL_IMPORT_REF OSCL_String & operator+= (const OSCL_String &src)
OSCL_IMPORT_REF OSCL_String & operator+= (const chartype *cstr)
OSCL_IMPORT_REF OSCL_String & operator+= (const chartype c)
OSCL_IMPORT_REF bool operator== (const OSCL_String &src) const
OSCL_IMPORT_REF bool operator!= (const OSCL_String &src) const
OSCL_IMPORT_REF bool operator< (const OSCL_String &src) const
OSCL_IMPORT_REF bool operator<= (const OSCL_String &src) const
OSCL_IMPORT_REF bool operator> (const OSCL_String &src) const
OSCL_IMPORT_REF bool operator>= (const OSCL_String &src) const
OSCL_IMPORT_REF bool operator== (const chartype *cstr) const
OSCL_IMPORT_REF chartype operator[] (uint32 index) const
virtual OSCL_IMPORT_REF chartype read (uint32 index) const
virtual OSCL_IMPORT_REF int8 hash () const
virtual OSCL_IMPORT_REF void write (uint32 index, chartype c)
virtual OSCL_IMPORT_REF void write (uint32 offset, uint32 length, const chartype *buf)

Protected Methods

OSCL_IMPORT_REF OSCL_String ()
virtual OSCL_IMPORT_REF ~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_IMPORT_REF OSCL_String::OSCL_String   [protected]
 

virtual OSCL_IMPORT_REF 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 OSCL_IMPORT_REF int8 OSCL_String::hash   [virtual]
 

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

virtual OSCL_IMPORT_REF bool OSCL_String::is_writable   [virtual]
 

This function returns true if the string is writable.

OSCL_IMPORT_REF bool OSCL_String::operator!= const OSCL_String &    src const
 

OSCL_IMPORT_REF 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_IMPORT_REF 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_IMPORT_REF 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.

OSCL_IMPORT_REF bool OSCL_String::operator< const OSCL_String &    src const
 

OSCL_IMPORT_REF bool OSCL_String::operator<= const OSCL_String &    src const
 

OSCL_IMPORT_REF 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_IMPORT_REF 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 >.

OSCL_IMPORT_REF bool OSCL_String::operator== const chartype   cstr const
 

Comparison operator

am: null-terminated string

OSCL_IMPORT_REF bool OSCL_String::operator== const OSCL_String &    src const
 

Comparison operators

OSCL_IMPORT_REF bool OSCL_String::operator> const OSCL_String &    src const
 

OSCL_IMPORT_REF bool OSCL_String::operator>= const OSCL_String &    src const
 

OSCL_IMPORT_REF 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 OSCL_IMPORT_REF 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 OSCL_IMPORT_REF 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 OSCL_IMPORT_REF 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 API
Posting Version: OPENCORE_20090310