00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(XMLENTITYDECL_HPP)
00023 #define XMLENTITYDECL_HPP
00024
00025 #include <xercesc/util/XMemory.hpp>
00026 #include <xercesc/util/PlatformUtils.hpp>
00027 #include <xercesc/util/XMLString.hpp>
00028 #include <xercesc/internal/XSerializable.hpp>
00029
00030 XERCES_CPP_NAMESPACE_BEGIN
00031
00050 class XMLEntityDecl : public XSerializable, public XMemory
00051 {
00052 public:
00053
00054
00055
00056
00059
00063 XMLEntityDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00064
00071 XMLEntityDecl
00072 (
00073 const XMLCh* const entName
00074 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00075 );
00076
00085 XMLEntityDecl
00086 (
00087 const XMLCh* const entName
00088 , const XMLCh* const value
00089 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00090 );
00091
00100 XMLEntityDecl
00101 (
00102 const XMLCh* const entName
00103 , const XMLCh value
00104 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00105 );
00107
00110
00114 virtual ~XMLEntityDecl();
00115
00117
00118
00119
00120
00121
00122
00125
00133 virtual bool getDeclaredInIntSubset() const = 0;
00134
00140 virtual bool getIsParameter() const = 0;
00141
00147 virtual bool getIsSpecialChar() const = 0;
00148
00150
00151
00152
00153
00154
00155
00158
00163 unsigned int getId() const;
00164
00170 const XMLCh* getName() const;
00171
00176 const XMLCh* getNotationName() const;
00177
00182 const XMLCh* getPublicId() const;
00183
00188 const XMLCh* getSystemId() const;
00189
00193 const XMLCh* getBaseURI() const;
00194
00200 const XMLCh* getValue() const;
00201
00207 unsigned int getValueLen() const;
00208
00213 bool isExternal() const;
00214
00220 bool isUnparsed() const;
00221
00229 MemoryManager* getMemoryManager() const;
00230
00232
00233
00234
00235
00236
00237
00240
00249 void setName
00250 (
00251 const XMLCh* const entName
00252 );
00253
00260 void setNotationName(const XMLCh* const newName);
00261
00268 void setPublicId(const XMLCh* const newId);
00269
00279 void setSystemId(const XMLCh* const newId);
00280
00287 void setBaseURI(const XMLCh* const newId);
00288
00296 void setValue(const XMLCh* const newValue);
00297
00299
00300
00301 void setId(const unsigned int newId);
00302
00303
00304
00305
00306
00307
00310
00317 const XMLCh* getKey() const;
00318
00320
00321
00322
00323
00324 DECL_XSERIALIZABLE(XMLEntityDecl)
00325
00326 private :
00327
00328
00329
00330 XMLEntityDecl(const XMLEntityDecl&);
00331 XMLEntityDecl& operator=(XMLEntityDecl&);
00332
00333
00334
00335
00336
00337 void cleanUp();
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368 unsigned int fId;
00369 unsigned int fValueLen;
00370 XMLCh* fValue;
00371 XMLCh* fName;
00372 XMLCh* fNotationName;
00373 XMLCh* fPublicId;
00374 XMLCh* fSystemId;
00375 XMLCh* fBaseURI;
00376 MemoryManager* fMemoryManager;
00377 };
00378
00379
00380
00381
00382
00383 inline unsigned int XMLEntityDecl::getId() const
00384 {
00385 return fId;
00386 }
00387
00388 inline const XMLCh* XMLEntityDecl::getName() const
00389 {
00390 return fName;
00391 }
00392
00393 inline const XMLCh* XMLEntityDecl::getNotationName() const
00394 {
00395 return fNotationName;
00396 }
00397
00398 inline const XMLCh* XMLEntityDecl::getPublicId() const
00399 {
00400 return fPublicId;
00401 }
00402
00403 inline const XMLCh* XMLEntityDecl::getSystemId() const
00404 {
00405 return fSystemId;
00406 }
00407
00408 inline const XMLCh* XMLEntityDecl::getBaseURI() const
00409 {
00410 return fBaseURI;
00411 }
00412
00413 inline const XMLCh* XMLEntityDecl::getValue() const
00414 {
00415 return fValue;
00416 }
00417
00418 inline unsigned int XMLEntityDecl::getValueLen() const
00419 {
00420 return fValueLen;
00421 }
00422
00423 inline bool XMLEntityDecl::isExternal() const
00424 {
00425
00426 return ((fPublicId != 0) || (fSystemId != 0));
00427 }
00428
00429 inline bool XMLEntityDecl::isUnparsed() const
00430 {
00431
00432 return (fNotationName != 0);
00433 }
00434
00435 inline MemoryManager* XMLEntityDecl::getMemoryManager() const
00436 {
00437 return fMemoryManager;
00438 }
00439
00440
00441
00442
00443 inline void XMLEntityDecl::setId(const unsigned int newId)
00444 {
00445 fId = newId;
00446 }
00447
00448 inline void XMLEntityDecl::setNotationName(const XMLCh* const newName)
00449 {
00450 if (fNotationName)
00451 fMemoryManager->deallocate(fNotationName);
00452
00453 fNotationName = XMLString::replicate(newName, fMemoryManager);
00454 }
00455
00456 inline void XMLEntityDecl::setPublicId(const XMLCh* const newId)
00457 {
00458 if (fPublicId)
00459 fMemoryManager->deallocate(fPublicId);
00460
00461 fPublicId = XMLString::replicate(newId, fMemoryManager);
00462 }
00463
00464 inline void XMLEntityDecl::setSystemId(const XMLCh* const newId)
00465 {
00466 if (fSystemId)
00467 fMemoryManager->deallocate(fSystemId);
00468
00469 fSystemId = XMLString::replicate(newId, fMemoryManager);
00470 }
00471
00472 inline void XMLEntityDecl::setBaseURI(const XMLCh* const newId)
00473 {
00474 if (fBaseURI)
00475 fMemoryManager->deallocate(fBaseURI);
00476
00477 fBaseURI = XMLString::replicate(newId, fMemoryManager);
00478 }
00479
00480 inline void XMLEntityDecl::setValue(const XMLCh* const newValue)
00481 {
00482 if (fValue)
00483 fMemoryManager->deallocate(fValue);
00484
00485 fValue = XMLString::replicate(newValue, fMemoryManager);
00486 fValueLen = XMLString::stringLen(newValue);
00487 }
00488
00489
00490
00491
00492
00493 inline const XMLCh* XMLEntityDecl::getKey() const
00494 {
00495 return fName;
00496 }
00497
00498 XERCES_CPP_NAMESPACE_END
00499
00500 #endif