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 #if !defined(XMLENTITYDECL_HPP)
00110 #define XMLENTITYDECL_HPP
00111
00112 #include <xercesc/util/XMemory.hpp>
00113 #include <xercesc/util/PlatformUtils.hpp>
00114 #include <xercesc/util/XMLString.hpp>
00115 #include <xercesc/internal/XSerializable.hpp>
00116
00117 XERCES_CPP_NAMESPACE_BEGIN
00118
00137 class XMLEntityDecl : public XSerializable, public XMemory
00138 {
00139 public:
00140
00141
00142
00143
00146
00150 XMLEntityDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00151
00158 XMLEntityDecl
00159 (
00160 const XMLCh* const entName
00161 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00162 );
00163
00172 XMLEntityDecl
00173 (
00174 const XMLCh* const entName
00175 , const XMLCh* const value
00176 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00177 );
00178
00187 XMLEntityDecl
00188 (
00189 const XMLCh* const entName
00190 , const XMLCh value
00191 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00192 );
00194
00197
00201 virtual ~XMLEntityDecl();
00202
00204
00205
00206
00207
00208
00209
00212
00220 virtual bool getDeclaredInIntSubset() const = 0;
00221
00227 virtual bool getIsParameter() const = 0;
00228
00234 virtual bool getIsSpecialChar() const = 0;
00235
00237
00238
00239
00240
00241
00242
00245
00250 unsigned int getId() const;
00251
00257 const XMLCh* getName() const;
00258
00263 const XMLCh* getNotationName() const;
00264
00269 const XMLCh* getPublicId() const;
00270
00275 const XMLCh* getSystemId() const;
00276
00280 const XMLCh* getBaseURI() const;
00281
00287 const XMLCh* getValue() const;
00288
00294 unsigned int getValueLen() const;
00295
00300 bool isExternal() const;
00301
00307 bool isUnparsed() const;
00308
00316 MemoryManager* getMemoryManager() const;
00317
00319
00320
00321
00322
00323
00324
00327
00336 void setName
00337 (
00338 const XMLCh* const entName
00339 );
00340
00347 void setNotationName(const XMLCh* const newName);
00348
00355 void setPublicId(const XMLCh* const newId);
00356
00366 void setSystemId(const XMLCh* const newId);
00367
00374 void setBaseURI(const XMLCh* const newId);
00375
00383 void setValue(const XMLCh* const newValue);
00384
00386
00387
00388 void setId(const unsigned int newId);
00389
00390
00391
00392
00393
00394
00397
00404 const XMLCh* getKey() const;
00405
00407
00408
00409
00410
00411 DECL_XSERIALIZABLE(XMLEntityDecl)
00412
00413 private :
00414
00415
00416
00417 XMLEntityDecl(const XMLEntityDecl&);
00418 XMLEntityDecl& operator=(XMLEntityDecl&);
00419
00420
00421
00422
00423
00424 void cleanUp();
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455 unsigned int fId;
00456 unsigned int fValueLen;
00457 XMLCh* fValue;
00458 XMLCh* fName;
00459 XMLCh* fNotationName;
00460 XMLCh* fPublicId;
00461 XMLCh* fSystemId;
00462 XMLCh* fBaseURI;
00463 MemoryManager* fMemoryManager;
00464 };
00465
00466
00467
00468
00469
00470 inline unsigned int XMLEntityDecl::getId() const
00471 {
00472 return fId;
00473 }
00474
00475 inline const XMLCh* XMLEntityDecl::getName() const
00476 {
00477 return fName;
00478 }
00479
00480 inline const XMLCh* XMLEntityDecl::getNotationName() const
00481 {
00482 return fNotationName;
00483 }
00484
00485 inline const XMLCh* XMLEntityDecl::getPublicId() const
00486 {
00487 return fPublicId;
00488 }
00489
00490 inline const XMLCh* XMLEntityDecl::getSystemId() const
00491 {
00492 return fSystemId;
00493 }
00494
00495 inline const XMLCh* XMLEntityDecl::getBaseURI() const
00496 {
00497 return fBaseURI;
00498 }
00499
00500 inline const XMLCh* XMLEntityDecl::getValue() const
00501 {
00502 return fValue;
00503 }
00504
00505 inline unsigned int XMLEntityDecl::getValueLen() const
00506 {
00507 return fValueLen;
00508 }
00509
00510 inline bool XMLEntityDecl::isExternal() const
00511 {
00512
00513 return ((fPublicId != 0) || (fSystemId != 0));
00514 }
00515
00516 inline bool XMLEntityDecl::isUnparsed() const
00517 {
00518
00519 return (fNotationName != 0);
00520 }
00521
00522 inline MemoryManager* XMLEntityDecl::getMemoryManager() const
00523 {
00524 return fMemoryManager;
00525 }
00526
00527
00528
00529
00530 inline void XMLEntityDecl::setId(const unsigned int newId)
00531 {
00532 fId = newId;
00533 }
00534
00535 inline void XMLEntityDecl::setNotationName(const XMLCh* const newName)
00536 {
00537 if (fNotationName)
00538 fMemoryManager->deallocate(fNotationName);
00539
00540 fNotationName = XMLString::replicate(newName, fMemoryManager);
00541 }
00542
00543 inline void XMLEntityDecl::setPublicId(const XMLCh* const newId)
00544 {
00545 if (fPublicId)
00546 fMemoryManager->deallocate(fPublicId);
00547
00548 fPublicId = XMLString::replicate(newId, fMemoryManager);
00549 }
00550
00551 inline void XMLEntityDecl::setSystemId(const XMLCh* const newId)
00552 {
00553 if (fSystemId)
00554 fMemoryManager->deallocate(fSystemId);
00555
00556 fSystemId = XMLString::replicate(newId, fMemoryManager);
00557 }
00558
00559 inline void XMLEntityDecl::setBaseURI(const XMLCh* const newId)
00560 {
00561 if (fBaseURI)
00562 fMemoryManager->deallocate(fBaseURI);
00563
00564 fBaseURI = XMLString::replicate(newId, fMemoryManager);
00565 }
00566
00567 inline void XMLEntityDecl::setValue(const XMLCh* const newValue)
00568 {
00569 if (fValue)
00570 fMemoryManager->deallocate(fValue);
00571
00572 fValue = XMLString::replicate(newValue, fMemoryManager);
00573 fValueLen = XMLString::stringLen(newValue);
00574 }
00575
00576
00577
00578
00579
00580 inline const XMLCh* XMLEntityDecl::getKey() const
00581 {
00582 return fName;
00583 }
00584
00585 XERCES_CPP_NAMESPACE_END
00586
00587 #endif