00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(XERCESC_INCLUDE_GUARD_XMLENTITYDECL_HPP)
00023 #define XERCESC_INCLUDE_GUARD_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 XMLPARSER_EXPORT 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 XMLSize_t 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 XMLSize_t 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
00259 void setIsExternal(bool value);
00260
00267 void setNotationName(const XMLCh* const newName);
00268
00275 void setPublicId(const XMLCh* const newId);
00276
00286 void setSystemId(const XMLCh* const newId);
00287
00294 void setBaseURI(const XMLCh* const newId);
00295
00303 void setValue(const XMLCh* const newValue);
00304
00306
00307
00308 void setId(const XMLSize_t newId);
00309
00310
00311
00312
00313
00314
00317
00324 const XMLCh* getKey() const;
00325
00327
00328
00329
00330
00331 DECL_XSERIALIZABLE(XMLEntityDecl)
00332
00333 private :
00334
00335
00336
00337 XMLEntityDecl(const XMLEntityDecl&);
00338 XMLEntityDecl& operator=(XMLEntityDecl&);
00339
00340
00341
00342
00343
00344 void cleanUp();
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375 XMLSize_t fId;
00376 XMLSize_t fValueLen;
00377 XMLCh* fValue;
00378 XMLCh* fName;
00379 XMLCh* fNotationName;
00380 XMLCh* fPublicId;
00381 XMLCh* fSystemId;
00382 XMLCh* fBaseURI;
00383 bool fIsExternal;
00384 MemoryManager* fMemoryManager;
00385 };
00386
00387
00388
00389
00390
00391 inline XMLSize_t XMLEntityDecl::getId() const
00392 {
00393 return fId;
00394 }
00395
00396 inline const XMLCh* XMLEntityDecl::getName() const
00397 {
00398 return fName;
00399 }
00400
00401 inline const XMLCh* XMLEntityDecl::getNotationName() const
00402 {
00403 return fNotationName;
00404 }
00405
00406 inline const XMLCh* XMLEntityDecl::getPublicId() const
00407 {
00408 return fPublicId;
00409 }
00410
00411 inline const XMLCh* XMLEntityDecl::getSystemId() const
00412 {
00413 return fSystemId;
00414 }
00415
00416 inline const XMLCh* XMLEntityDecl::getBaseURI() const
00417 {
00418 return fBaseURI;
00419 }
00420
00421 inline const XMLCh* XMLEntityDecl::getValue() const
00422 {
00423 return fValue;
00424 }
00425
00426 inline XMLSize_t XMLEntityDecl::getValueLen() const
00427 {
00428 return fValueLen;
00429 }
00430
00431 inline bool XMLEntityDecl::isExternal() const
00432 {
00433 return fIsExternal;
00434 }
00435
00436 inline bool XMLEntityDecl::isUnparsed() const
00437 {
00438
00439 return (fNotationName != 0);
00440 }
00441
00442 inline MemoryManager* XMLEntityDecl::getMemoryManager() const
00443 {
00444 return fMemoryManager;
00445 }
00446
00447
00448
00449
00450 inline void XMLEntityDecl::setId(const XMLSize_t newId)
00451 {
00452 fId = newId;
00453 }
00454
00455 inline void XMLEntityDecl::setIsExternal(bool value)
00456 {
00457 fIsExternal = value;
00458 }
00459
00460 inline void XMLEntityDecl::setNotationName(const XMLCh* const newName)
00461 {
00462 if (fNotationName)
00463 fMemoryManager->deallocate(fNotationName);
00464
00465 fNotationName = XMLString::replicate(newName, fMemoryManager);
00466 }
00467
00468 inline void XMLEntityDecl::setPublicId(const XMLCh* const newId)
00469 {
00470 if (fPublicId)
00471 fMemoryManager->deallocate(fPublicId);
00472
00473 fPublicId = XMLString::replicate(newId, fMemoryManager);
00474 }
00475
00476 inline void XMLEntityDecl::setSystemId(const XMLCh* const newId)
00477 {
00478 if (fSystemId)
00479 fMemoryManager->deallocate(fSystemId);
00480
00481 fSystemId = XMLString::replicate(newId, fMemoryManager);
00482 }
00483
00484 inline void XMLEntityDecl::setBaseURI(const XMLCh* const newId)
00485 {
00486 if (fBaseURI)
00487 fMemoryManager->deallocate(fBaseURI);
00488
00489 fBaseURI = XMLString::replicate(newId, fMemoryManager);
00490 }
00491
00492 inline void XMLEntityDecl::setValue(const XMLCh* const newValue)
00493 {
00494 if (fValue)
00495 fMemoryManager->deallocate(fValue);
00496
00497 fValue = XMLString::replicate(newValue, fMemoryManager);
00498 fValueLen = XMLString::stringLen(newValue);
00499 }
00500
00501
00502
00503
00504
00505 inline const XMLCh* XMLEntityDecl::getKey() const
00506 {
00507 return fName;
00508 }
00509
00510 XERCES_CPP_NAMESPACE_END
00511
00512 #endif