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
00114
00115
00116
00117
00118
00119 #ifndef DOMString_HEADER_GUARD_
00120 #define DOMString_HEADER_GUARD_
00121
00122 #include <xercesc/util/XercesDefs.hpp>
00123
00124 #ifdef XML_DEBUG
00125 #include "DOMStringImpl.hpp"
00126 #else
00127 class DOMStringHandle;
00128 #endif
00129
00130 class DOM_NullPtr;
00131
00139
00140 class DOMString {
00141 public:
00144
00149 DOMString();
00150
00156 DOMString(const DOMString &other);
00157
00165 DOMString(const XMLCh *other);
00166
00173 DOMString(const XMLCh *other, unsigned int length);
00174
00182 DOMString(const char *other);
00183
00187 DOMString(int nullPointerValue);
00188
00195 DOMString & operator = (const DOMString &other);
00196
00197
00198
00199 DOMString & operator = (DOM_NullPtr *other);
00200
00202
00204
00209 ~DOMString();
00210
00212
00214
00221
00222
00224
00226
00239 bool operator == (const DOMString &other) const;
00240
00253 bool operator != (const DOMString &other) const;
00254
00263 bool operator == (const DOM_NullPtr *other) const;
00264
00271 bool operator != (const DOM_NullPtr *other) const;
00272
00274
00276
00277
00285 void reserve(unsigned int size);
00286
00287
00293 void appendData(const DOMString &other);
00294
00300 void appendData(XMLCh ch);
00301
00307 void appendData(const XMLCh *other);
00308
00309
00315 DOMString& operator +=(const DOMString &other);
00316
00317
00323 DOMString& operator +=(const XMLCh* other);
00324
00325
00331 DOMString& operator +=(XMLCh ch);
00332
00333
00340 void deleteData(unsigned int offset, unsigned int count);
00341
00350 void insertData(unsigned int offset, const DOMString &data);
00351
00353
00355
00362 XMLCh charAt(unsigned int index) const;
00363
00372 const XMLCh *rawBuffer() const;
00373
00382 char *transcode() const;
00383
00384
00392 static DOMString transcode(const char* str);
00393
00394
00395
00403 DOMString substringData(unsigned int offset, unsigned int count) const;
00404
00410 unsigned int length() const;
00411
00413
00415
00421 DOMString clone() const;
00422
00424
00426
00431 void print() const;
00432
00437 void println() const;
00438
00440
00442
00454 int compareString(const DOMString &other) const;
00455
00463 bool equals(const DOMString &other) const;
00464
00465
00473 bool equals(const XMLCh *other) const;
00474
00475
00477 friend class DOMStringData;
00478 friend class DOMStringHandle;
00479 friend class DomMemDebug;
00480 private:
00481
00482 DOMStringHandle *fHandle;
00483 static int gLiveStringHandleCount;
00484 static int gTotalStringHandleCount;
00485 static int gLiveStringDataCount;
00486 static int gTotalStringDataCount;
00487 };
00488
00489
00490
00491
00499 DOMString operator + (const DOMString &lhs, const DOMString &rhs);
00500
00508 DOMString operator + (const DOMString &lhs, const XMLCh* rhs);
00509
00510
00518 DOMString operator + (const XMLCh* lhs, const DOMString &rhs);
00519
00520
00528 DOMString operator + (const DOMString &lhs, XMLCh rhs);
00529
00530
00538 DOMString operator + (XMLCh lhs, const DOMString &rhs);
00539
00540 #endif