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 #if !defined(XMLENTITYDECL_HPP)
00083 #define XMLENTITYDECL_HPP
00084
00085 #include <util/XMLString.hpp>
00086
00105 class XMLEntityDecl
00106 {
00107 public:
00108
00109
00110
00111
00113
00114
00118 XMLEntityDecl();
00119
00124 XMLEntityDecl
00125 (
00126 const XMLCh* const entName
00127 );
00128
00135 XMLEntityDecl
00136 (
00137 const XMLCh* const entName
00138 , const XMLCh* const value
00139 );
00140
00147 XMLEntityDecl
00148 (
00149 const XMLCh* const entName
00150 , const XMLCh value
00151 );
00152
00153
00155
00156
00160 virtual ~XMLEntityDecl();
00161
00162
00163
00164
00165
00166
00167
00168
00170
00171
00179 virtual bool getDeclaredInIntSubset() const = 0;
00180
00186 virtual bool getIsParameter() const = 0;
00187
00193 virtual bool getIsSpecialChar() const = 0;
00194
00195
00196
00197
00198
00199
00200
00201
00203
00204
00209 unsigned int getId() const;
00210
00216 const XMLCh* getName() const;
00217
00222 const XMLCh* getNotationName() const;
00223
00228 const XMLCh* getPublicId() const;
00229
00234 const XMLCh* getSystemId() const;
00235
00241 const XMLCh* getValue() const;
00242
00248 unsigned int getValueLen() const;
00249
00254 bool isExternal() const;
00255
00261 bool isUnparsed() const;
00262
00263
00264
00265
00266
00267
00268
00269
00271
00272
00281 void setName
00282 (
00283 const XMLCh* const entName
00284 );
00285
00292 void setNotationName(const XMLCh* const newName);
00293
00300 void setPublicId(const XMLCh* const newId);
00301
00311 void setSystemId(const XMLCh* const newId);
00312
00320 void setValue(const XMLCh* const newValue);
00321
00322
00323
00324
00325 void setId(const unsigned int newId);
00326
00327
00328
00329
00330
00331
00333
00334
00341 const XMLCh* getKey() const;
00342
00343
00344
00345
00346 private :
00347
00348
00349
00350 XMLEntityDecl(const XMLEntityDecl&);
00351 void operator=(XMLEntityDecl&);
00352
00353
00354
00355
00356
00357 void cleanUp();
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384 unsigned int fId;
00385 XMLCh* fName;
00386 XMLCh* fNotationName;
00387 XMLCh* fPublicId;
00388 XMLCh* fSystemId;
00389 XMLCh* fValue;
00390 unsigned int fValueLen;
00391 };
00392
00393
00394
00395
00396
00397 inline unsigned int XMLEntityDecl::getId() const
00398 {
00399 return fId;
00400 }
00401
00402 inline const XMLCh* XMLEntityDecl::getName() const
00403 {
00404 return fName;
00405 }
00406
00407 inline const XMLCh* XMLEntityDecl::getNotationName() const
00408 {
00409 return fNotationName;
00410 }
00411
00412 inline const XMLCh* XMLEntityDecl::getPublicId() const
00413 {
00414 return fPublicId;
00415 }
00416
00417 inline const XMLCh* XMLEntityDecl::getSystemId() const
00418 {
00419 return fSystemId;
00420 }
00421
00422 inline const XMLCh* XMLEntityDecl::getValue() const
00423 {
00424 return fValue;
00425 }
00426
00427 inline unsigned int XMLEntityDecl::getValueLen() const
00428 {
00429 return fValueLen;
00430 }
00431
00432 inline bool XMLEntityDecl::isExternal() const
00433 {
00434
00435 return ((fPublicId != 0) || (fSystemId != 0));
00436 }
00437
00438 inline bool XMLEntityDecl::isUnparsed() const
00439 {
00440
00441 return (fNotationName != 0);
00442 }
00443
00444
00445
00446
00447
00448 inline void XMLEntityDecl::setId(const unsigned int newId)
00449 {
00450 fId = newId;
00451 }
00452
00453 inline void XMLEntityDecl::setNotationName(const XMLCh* const newName)
00454 {
00455 delete [] fNotationName;
00456 fNotationName = XMLString::replicate(newName);
00457 }
00458
00459 inline void XMLEntityDecl::setPublicId(const XMLCh* const newId)
00460 {
00461 delete [] fPublicId;
00462 fPublicId = XMLString::replicate(newId);
00463 }
00464
00465 inline void XMLEntityDecl::setSystemId(const XMLCh* const newId)
00466 {
00467 delete [] fSystemId;
00468 fSystemId = XMLString::replicate(newId);
00469 }
00470
00471 inline void XMLEntityDecl::setValue(const XMLCh* const newValue)
00472 {
00473 delete [] fValue;
00474 fValue = XMLString::replicate(newValue);
00475 fValueLen = XMLString::stringLen(newValue);
00476 }
00477
00478
00479
00480
00481
00482 inline const XMLCh* XMLEntityDecl::getKey() const
00483 {
00484 return fName;
00485 }
00486
00487 #endif