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

OSCL_FastString Class Reference
[OSCL Util]

#include <oscl_string_containers.h>

Inheritance diagram for OSCL_FastString:

OSCL_String HeapBase _OsclHeapBase

Public Types

typedef OSCL_String::chartype chartype

Public Methods

OSCL_IMPORT_REF OSCL_FastString ()
OSCL_IMPORT_REF OSCL_FastString (const OSCL_FastString &src)
OSCL_IMPORT_REF OSCL_FastString (const chartype *cstr)
OSCL_IMPORT_REF OSCL_FastString (chartype *buf, uint32 maxlen)
OSCL_IMPORT_REF ~OSCL_FastString ()
OSCL_IMPORT_REF uint32 get_size () const
OSCL_IMPORT_REF uint32 get_maxsize () const
OSCL_IMPORT_REF const chartypeget_cstr () const
OSCL_IMPORT_REF chartypeget_str () const
OSCL_IMPORT_REF OSCL_FastString & operator= (const OSCL_FastString &src)
OSCL_IMPORT_REF OSCL_FastString & operator= (const chartype *cstr)
OSCL_IMPORT_REF void set (chartype *cstr, uint32 maxlen)
OSCL_IMPORT_REF void set_length ()

Friends

class OSCL_String

Detailed Description

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

This class does not allocate internal memory for the string but acts as a container for a user-defined buffer. This means no copying of the string is done and provides a faster way of manipulating strings. Depending on initialization, this container provides either read-only or read-write access to the string.

Implementation assumes the input string is null-terminated.

Parameters:
C:  type of character.


Member Typedef Documentation

typedef OSCL_String::chartype OSCL_FastString::chartype
 

Reimplemented from OSCL_String.


Constructor & Destructor Documentation

OSCL_IMPORT_REF OSCL_FastString::OSCL_FastString  
 

Default constructor.

OSCL_IMPORT_REF OSCL_FastString::OSCL_FastString const OSCL_FastString &    src
 

Creates a fast string that contains a copy of the input string. The string inherits the writable-ness of the source string.

Parameters:
src:  input string.

OSCL_IMPORT_REF OSCL_FastString::OSCL_FastString const chartype   cstr
 

Create the string and initialize it to contain the input string. The string is not writable.

am: null-terminated string.

OSCL_IMPORT_REF OSCL_FastString::OSCL_FastString chartype   buf,
uint32    maxlen
 

Create the string and initialize it to contain the input string. The string is writable.

Parameters:
cp:  null-terminated string.
maxlen:  maximum size of storage at cp, not incl null terminator. If input string is not null-terminated, the function leaves.

OSCL_IMPORT_REF OSCL_FastString::~OSCL_FastString  
 


Member Function Documentation

OSCL_IMPORT_REF const chartype* OSCL_FastString::get_cstr   [virtual]
 

This function returns the C-style string for read access.

Implements OSCL_String.

OSCL_IMPORT_REF uint32 OSCL_FastString::get_maxsize   [virtual]
 

This function returns the maximum available storage size, not including null terminator. The maximum size may be larger than the current string size.

Implements OSCL_String.

OSCL_IMPORT_REF uint32 OSCL_FastString::get_size   [virtual]
 

Pure virtuals from OSCL_String

Implements OSCL_String.

OSCL_IMPORT_REF chartype* OSCL_FastString::get_str   [virtual]
 

This function returns the C-style string for write access. If the string is not writable it returns NULL.

Implements OSCL_String.

OSCL_IMPORT_REF OSCL_FastString& OSCL_FastString::operator= const chartype   cstr
 

Assignment operator

am: null-terminated string

Reimplemented from OSCL_String.

OSCL_IMPORT_REF OSCL_FastString& OSCL_FastString::operator= const OSCL_FastString &    src
 

Assignment operators

OSCL_IMPORT_REF void OSCL_FastString::set chartype   cstr,
uint32    maxlen
 

This function can be used to reassign the string to a new writable string. If input string is not null-terminated, the function leaves.

OSCL_IMPORT_REF void OSCL_FastString::set_length  
 

This function can be used to refresh the string size in case the contents of the string buffer have been modified since the container was created.


Friends And Related Function Documentation

friend class OSCL_String [friend]
 


The documentation for this class was generated from the following file:
OSCL API
Posting Version: OPENCORE_20090310