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

# oscl_string_rep.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00003
    00004 //               O S C L_ S T R I N G _ R E P
    00005 //
    00006 //    This file contains a standardized set of string containers that
    00007 //    can be used in place of character arrays.
    00008
    00009 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00010
    00024 #ifndef OSCL_STRING_REP_H_INCLUDED
    00025 #define OSCL_STRING_REP_H_INCLUDED
    00026
    00027
    00028 #ifndef OSCL_DEFALLOC_H_INCLUDED
    00029 #include "oscl_defalloc.h"
    00030 #endif
    00031
    00032
    00033
    00036 class CHeapRep
    00037 {
    00038     public:
    00039         CHeapRep()
    00040                 : refcount(0)
    00041                 , buffer(NULL)
    00042                 , maxsize(0)
    00043                 , size(0)
    00044         {}
    00045
    00046         OSCL_IMPORT_REF static void set_rep(CHeapRep*&, Oscl_DefAlloc&, const char*, uint32);
    00047         OSCL_IMPORT_REF static void set_rep(CHeapRep*&, Oscl_DefAlloc&, const oscl_wchar*, uint32);
    00048         OSCL_IMPORT_REF static void append_rep(CHeapRep*&, Oscl_DefAlloc&, const char*, uint32);
    00049         OSCL_IMPORT_REF static void append_rep(CHeapRep*&, Oscl_DefAlloc&, const oscl_wchar*, uint32);
    00050
    00051         uint32 refcount;
    00052         OsclAny* buffer;
    00053         uint32 maxsize;
    00054         uint32 size;
    00055         OSCL_IMPORT_REF bool set(uint32, const char*, Oscl_DefAlloc &);
    00056         OSCL_IMPORT_REF bool set(uint32, const oscl_wchar*, Oscl_DefAlloc &);
    00057         OSCL_IMPORT_REF bool append(uint32, const char*, uint32, const char*, Oscl_DefAlloc &);
    00058         OSCL_IMPORT_REF bool append(uint32, const oscl_wchar*, uint32, const oscl_wchar*, Oscl_DefAlloc &);
    00059         OSCL_IMPORT_REF void add_ref();
    00060         OSCL_IMPORT_REF void remove_ref(Oscl_DefAlloc &);
    00061
    00062         OSCL_IMPORT_REF static void assign(CHeapRep*&, CHeapRep*, Oscl_DefAlloc &);
    00063     private:
    00064         static CHeapRep *New(Oscl_DefAlloc &);
    00065 };
    00066
    00069 class CStackRep
    00070 {
    00071     public:
    00072         CStackRep()
    00073                 : maxsize(0)
    00074                 , size(0)
    00075                 , buffer(NULL)
    00076         {}
    00077         uint32 maxsize;
    00078         uint32 size;
    00079         OsclAny* buffer;
    00080         OSCL_IMPORT_REF void set(const char* cp, uint32 len);
    00081         OSCL_IMPORT_REF void set(const oscl_wchar* cp, uint32 len);
    00082         OSCL_IMPORT_REF void append(const char* cp, uint32 len);
    00083         OSCL_IMPORT_REF void append(const oscl_wchar* cp, uint32 len);
    00084 };
    00085
    00086
    00089 class CFastRep
    00090 {
    00091     public:
    00092         CFastRep()
    00093                 : maxsize(0)
    00094                 , size(0)
    00095                 , buffer(NULL)
    00096                 , writable(false)
    00097                 , overwrite(false)
    00098         {}
    00099         uint32 maxsize;
    00100         uint32 size;
    00101         OsclAny* buffer;
    00102         bool writable;
    00103         bool overwrite;
    00104         OSCL_IMPORT_REF void set_w(char* cp, uint32 len, uint32 maxlen);
    00105         OSCL_IMPORT_REF void set_w(oscl_wchar* cp, uint32 len, uint32 maxlen);
    00106         OSCL_IMPORT_REF void set_r(const char* cp, uint32 len);
    00107         OSCL_IMPORT_REF void set_r(const oscl_wchar* cp, uint32 len);
    00108         OSCL_IMPORT_REF void append(const char* cp, uint32 len);
    00109         OSCL_IMPORT_REF void append(const oscl_wchar* cp, uint32 len);
    00110 };
    00111
    00112
    00113 #endif   // OSCL_STRING_REP_H_INCLUDED
    00114