00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074 
00075 
00076 
00077 
00078 
00079 
00080 
00081 
00082 
00083 
00084 
00085 
00086 
00087 
00088 
00089 
00090 
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 
00109 
00110 
00111 
00112 
00113 #ifndef DOMString_HEADER_GUARD_
00114 #define DOMString_HEADER_GUARD_
00115 
00116 #include <util/XercesDefs.hpp>
00117 
00118 #ifdef XML_DEBUG
00119 #include "DOMStringImpl.hpp"
00120 #else
00121 class DOMStringHandle;
00122 #endif
00123 
00124 class DOM_NullPtr;
00125 
00133 
00134 class  DOMString {
00135 public:
00138 
00143     DOMString();
00144 
00150     DOMString(const DOMString &other);
00151 
00159     DOMString(const XMLCh *other);
00160 
00167     DOMString(const XMLCh *other, unsigned int length);
00168 
00176     DOMString(const char *other);
00177 
00181     DOMString(int nullPointerValue);
00182 
00189     DOMString &        operator = (const DOMString &other);
00190 
00191 
00192 
00193     DOMString &        operator = (DOM_NullPtr *other);
00194 
00196 
00198 
00203     ~DOMString();
00204 
00206 
00208 
00215     
00216 
00218 
00220 
00233     bool        operator == (const DOMString &other) const;
00234 
00247     bool        operator != (const DOMString &other) const;
00248 
00257     bool        operator == (const DOM_NullPtr *other) const;
00258 
00265     bool        operator != (const DOM_NullPtr *other) const;
00266 
00268 
00270 
00271 
00279     void reserve(unsigned int size);
00280 
00281     
00287     void        appendData(const DOMString &other);
00288 
00294     void        appendData(XMLCh ch);
00295 
00301     void        appendData(const XMLCh *other);
00302 
00303 
00309     DOMString& operator +=(const DOMString &other);
00310 
00311 
00317     DOMString& operator +=(const XMLCh* other);
00318 
00319 
00325     DOMString& operator +=(XMLCh ch);
00326 
00327 
00334     void        deleteData(unsigned int offset, unsigned int count);
00335 
00344     void        insertData(unsigned int offset, const DOMString &data);
00345 
00347 
00349 
00356     XMLCh       charAt(unsigned int index) const;
00357 
00366     const XMLCh *rawBuffer() const;
00367 
00376     char        *transcode() const;
00377 
00378 
00386     static DOMString transcode(const char* str);
00387 
00388 
00389 
00397     DOMString   substringData(unsigned int offset, unsigned int count) const;
00398 
00404     unsigned int length() const;
00405 
00407 
00409 
00415     DOMString   clone() const;
00416 
00418 
00420 
00425     void        print() const;
00426 
00431     void        println() const;
00432 
00434 
00436 
00448     int         compareString(const DOMString &other) const;
00449 
00457     bool        equals(const DOMString &other) const;
00458 
00459 
00467     bool        equals(const XMLCh  *other) const;
00468 
00469 
00471     friend      class DOMStringData;
00472     friend      class DOMStringHandle;
00473     friend      class DomMemDebug;
00474 private:
00475 
00476     DOMStringHandle         *fHandle;
00477     static int              gLiveStringHandleCount;
00478     static int              gTotalStringHandleCount;
00479     static int              gLiveStringDataCount;
00480     static int              gTotalStringDataCount;
00481 };
00482 
00483 
00484 
00485 
00493 DOMString  operator + (const DOMString &lhs, const DOMString &rhs);
00494 
00502 DOMString  operator + (const DOMString &lhs, const XMLCh* rhs);
00503 
00504 
00512 DOMString  operator + (const XMLCh* lhs, const DOMString &rhs);
00513 
00514 
00522 DOMString  operator + (const DOMString &lhs, XMLCh rhs);
00523 
00524 
00532 DOMString  operator + (XMLCh lhs, const DOMString &rhs);
00533 
00534 #endif