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 #if !defined(XMLENTITYDECL_HPP)
00104 #define XMLENTITYDECL_HPP
00105
00106 #include <xercesc/util/XMemory.hpp>
00107 #include <xercesc/util/PlatformUtils.hpp>
00108 #include <xercesc/util/XMLString.hpp>
00109
00110 XERCES_CPP_NAMESPACE_BEGIN
00111
00130 class XMLEntityDecl : public XMemory
00131 {
00132 public:
00133
00134
00135
00136
00139
00143 XMLEntityDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00144
00149 XMLEntityDecl
00150 (
00151 const XMLCh* const entName
00152 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00153 );
00154
00161 XMLEntityDecl
00162 (
00163 const XMLCh* const entName
00164 , const XMLCh* const value
00165 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00166 );
00167
00174 XMLEntityDecl
00175 (
00176 const XMLCh* const entName
00177 , const XMLCh value
00178 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00179 );
00181
00184
00188 virtual ~XMLEntityDecl();
00189
00191
00192
00193
00194
00195
00196
00199
00207 virtual bool getDeclaredInIntSubset() const = 0;
00208
00214 virtual bool getIsParameter() const = 0;
00215
00221 virtual bool getIsSpecialChar() const = 0;
00222
00224
00225
00226
00227
00228
00229
00232
00237 unsigned int getId() const;
00238
00244 const XMLCh* getName() const;
00245
00250 const XMLCh* getNotationName() const;
00251
00256 const XMLCh* getPublicId() const;
00257
00262 const XMLCh* getSystemId() const;
00263
00267 const XMLCh* getBaseURI() const;
00268
00274 const XMLCh* getValue() const;
00275
00281 unsigned int getValueLen() const;
00282
00287 bool isExternal() const;
00288
00294 bool isUnparsed() const;
00295
00303 MemoryManager* getMemoryManager() const;
00304
00306
00307
00308
00309
00310
00311
00314
00323 void setName
00324 (
00325 const XMLCh* const entName
00326 );
00327
00334 void setNotationName(const XMLCh* const newName);
00335
00342 void setPublicId(const XMLCh* const newId);
00343
00353 void setSystemId(const XMLCh* const newId);
00354
00361 void setBaseURI(const XMLCh* const newId);
00362
00370 void setValue(const XMLCh* const newValue);
00371
00373
00374
00375 void setId(const unsigned int newId);
00376
00377
00378
00379
00380
00381
00384
00391 const XMLCh* getKey() const;
00392
00394
00395
00396 private :
00397
00398
00399
00400 XMLEntityDecl(const XMLEntityDecl&);
00401 XMLEntityDecl& operator=(XMLEntityDecl&);
00402
00403
00404
00405
00406
00407 void cleanUp();
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438 unsigned int fId;
00439 unsigned int fValueLen;
00440 XMLCh* fValue;
00441 XMLCh* fName;
00442 XMLCh* fNotationName;
00443 XMLCh* fPublicId;
00444 XMLCh* fSystemId;
00445 XMLCh* fBaseURI;
00446 MemoryManager* fMemoryManager;
00447 };
00448
00449
00450
00451
00452
00453 inline unsigned int XMLEntityDecl::getId() const
00454 {
00455 return fId;
00456 }
00457
00458 inline const XMLCh* XMLEntityDecl::getName() const
00459 {
00460 return fName;
00461 }
00462
00463 inline const XMLCh* XMLEntityDecl::getNotationName() const
00464 {
00465 return fNotationName;
00466 }
00467
00468 inline const XMLCh* XMLEntityDecl::getPublicId() const
00469 {
00470 return fPublicId;
00471 }
00472
00473 inline const XMLCh* XMLEntityDecl::getSystemId() const
00474 {
00475 return fSystemId;
00476 }
00477
00478 inline const XMLCh* XMLEntityDecl::getBaseURI() const
00479 {
00480 return fBaseURI;
00481 }
00482
00483 inline const XMLCh* XMLEntityDecl::getValue() const
00484 {
00485 return fValue;
00486 }
00487
00488 inline unsigned int XMLEntityDecl::getValueLen() const
00489 {
00490 return fValueLen;
00491 }
00492
00493 inline bool XMLEntityDecl::isExternal() const
00494 {
00495
00496 return ((fPublicId != 0) || (fSystemId != 0));
00497 }
00498
00499 inline bool XMLEntityDecl::isUnparsed() const
00500 {
00501
00502 return (fNotationName != 0);
00503 }
00504
00505 inline MemoryManager* XMLEntityDecl::getMemoryManager() const
00506 {
00507 return fMemoryManager;
00508 }
00509
00510
00511
00512
00513 inline void XMLEntityDecl::setId(const unsigned int newId)
00514 {
00515 fId = newId;
00516 }
00517
00518 inline void XMLEntityDecl::setNotationName(const XMLCh* const newName)
00519 {
00520 if (fNotationName)
00521 fMemoryManager->deallocate(fNotationName);
00522
00523 fNotationName = XMLString::replicate(newName, fMemoryManager);
00524 }
00525
00526 inline void XMLEntityDecl::setPublicId(const XMLCh* const newId)
00527 {
00528 if (fPublicId)
00529 fMemoryManager->deallocate(fPublicId);
00530
00531 fPublicId = XMLString::replicate(newId, fMemoryManager);
00532 }
00533
00534 inline void XMLEntityDecl::setSystemId(const XMLCh* const newId)
00535 {
00536 if (fSystemId)
00537 fMemoryManager->deallocate(fSystemId);
00538
00539 fSystemId = XMLString::replicate(newId, fMemoryManager);
00540 }
00541
00542 inline void XMLEntityDecl::setBaseURI(const XMLCh* const newId)
00543 {
00544 if (fBaseURI)
00545 fMemoryManager->deallocate(fBaseURI);
00546
00547 fBaseURI = XMLString::replicate(newId, fMemoryManager);
00548 }
00549
00550 inline void XMLEntityDecl::setValue(const XMLCh* const newValue)
00551 {
00552 if (fValue)
00553 fMemoryManager->deallocate(fValue);
00554
00555 fValue = XMLString::replicate(newValue, fMemoryManager);
00556 fValueLen = XMLString::stringLen(newValue);
00557 }
00558
00559
00560
00561
00562
00563 inline const XMLCh* XMLEntityDecl::getKey() const
00564 {
00565 return fName;
00566 }
00567
00568 XERCES_CPP_NAMESPACE_END
00569
00570 #endif