00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #if !defined(XMLENTITYDECL_HPP)
00022 #define XMLENTITYDECL_HPP
00023 
00024 #include <xercesc/util/XMemory.hpp>
00025 #include <xercesc/util/PlatformUtils.hpp>
00026 #include <xercesc/util/XMLString.hpp>
00027 #include <xercesc/internal/XSerializable.hpp>
00028 
00029 XERCES_CPP_NAMESPACE_BEGIN
00030 
00049 class  XMLEntityDecl : public XSerializable, public XMemory
00050 {
00051 public:
00052     
00053     
00054     
00055 
00058 
00062     XMLEntityDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00063 
00070     XMLEntityDecl
00071     (
00072         const   XMLCh* const    entName
00073         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00074     );
00075 
00084     XMLEntityDecl
00085     (
00086         const   XMLCh* const    entName
00087         , const XMLCh* const    value
00088         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00089     );
00090 
00099     XMLEntityDecl
00100     (
00101         const   XMLCh* const    entName
00102         , const XMLCh           value
00103         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00104     );
00106 
00109 
00113     virtual ~XMLEntityDecl();
00114 
00116 
00117 
00118     
00119     
00120     
00121 
00124 
00132     virtual bool getDeclaredInIntSubset() const = 0;
00133 
00139     virtual bool getIsParameter() const = 0;
00140 
00146     virtual bool getIsSpecialChar() const = 0;
00147 
00149 
00150 
00151     
00152     
00153     
00154 
00157 
00162     unsigned int getId() const;
00163 
00169     const XMLCh* getName() const;
00170 
00175     const XMLCh* getNotationName() const;
00176 
00181     const XMLCh* getPublicId() const;
00182 
00187     const XMLCh* getSystemId() const;
00188 
00192     const XMLCh* getBaseURI() const;
00193 
00199     const XMLCh* getValue() const;
00200 
00206     unsigned int getValueLen() const;
00207 
00212     bool isExternal() const;
00213 
00219     bool isUnparsed() const;
00220 
00228     MemoryManager* getMemoryManager() const;
00229 
00231 
00232 
00233     
00234     
00235     
00236 
00239 
00248     void setName
00249     (
00250         const   XMLCh* const    entName
00251     );
00252 
00259     void setNotationName(const XMLCh* const newName);
00260 
00267     void setPublicId(const XMLCh* const newId);
00268 
00278     void setSystemId(const XMLCh* const newId);
00279 
00286     void setBaseURI(const XMLCh* const newId);
00287 
00295     void setValue(const XMLCh* const newValue);
00296 
00298 
00299     
00300     void setId(const unsigned int newId);
00301 
00302 
00303     
00304     
00305     
00306 
00309 
00316     const XMLCh* getKey() const;
00317 
00319 
00320     
00321 
00322 
00323     DECL_XSERIALIZABLE(XMLEntityDecl)
00324 
00325 private :
00326     
00327     
00328     
00329     XMLEntityDecl(const XMLEntityDecl&);
00330     XMLEntityDecl& operator=(XMLEntityDecl&);
00331 
00332 
00333     
00334     
00335     
00336     void cleanUp();
00337 
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     unsigned int    fId;
00368     unsigned int    fValueLen;
00369     XMLCh*          fValue;
00370     XMLCh*          fName;
00371     XMLCh*          fNotationName;
00372     XMLCh*          fPublicId;
00373     XMLCh*          fSystemId;
00374     XMLCh*          fBaseURI;
00375     MemoryManager*  fMemoryManager;
00376 };
00377 
00378 
00379 
00380 
00381 
00382 inline unsigned int XMLEntityDecl::getId() const
00383 {
00384     return fId;
00385 }
00386 
00387 inline const XMLCh* XMLEntityDecl::getName() const
00388 {
00389     return fName;
00390 }
00391 
00392 inline const XMLCh* XMLEntityDecl::getNotationName() const
00393 {
00394     return fNotationName;
00395 }
00396 
00397 inline const XMLCh* XMLEntityDecl::getPublicId() const
00398 {
00399     return fPublicId;
00400 }
00401 
00402 inline const XMLCh* XMLEntityDecl::getSystemId() const
00403 {
00404     return fSystemId;
00405 }
00406 
00407 inline const XMLCh* XMLEntityDecl::getBaseURI() const
00408 {
00409     return fBaseURI;
00410 }
00411 
00412 inline const XMLCh* XMLEntityDecl::getValue() const
00413 {
00414     return fValue;
00415 }
00416 
00417 inline unsigned int XMLEntityDecl::getValueLen() const
00418 {
00419     return fValueLen;
00420 }
00421 
00422 inline bool XMLEntityDecl::isExternal() const
00423 {
00424     
00425     return ((fPublicId != 0) || (fSystemId != 0));
00426 }
00427 
00428 inline bool XMLEntityDecl::isUnparsed() const
00429 {
00430     
00431     return (fNotationName != 0);
00432 }
00433 
00434 inline MemoryManager* XMLEntityDecl::getMemoryManager() const
00435 {
00436     return fMemoryManager;
00437 }
00438 
00439 
00440 
00441 
00442 inline void XMLEntityDecl::setId(const unsigned int newId)
00443 {
00444     fId = newId;
00445 }
00446 
00447 inline void XMLEntityDecl::setNotationName(const XMLCh* const newName)
00448 {
00449     if (fNotationName)
00450         fMemoryManager->deallocate(fNotationName);
00451 
00452     fNotationName = XMLString::replicate(newName, fMemoryManager);
00453 }
00454 
00455 inline void XMLEntityDecl::setPublicId(const XMLCh* const newId)
00456 {
00457     if (fPublicId)
00458         fMemoryManager->deallocate(fPublicId);
00459 
00460     fPublicId = XMLString::replicate(newId, fMemoryManager);
00461 }
00462 
00463 inline void XMLEntityDecl::setSystemId(const XMLCh* const newId)
00464 {
00465     if (fSystemId)
00466         fMemoryManager->deallocate(fSystemId);
00467 
00468     fSystemId = XMLString::replicate(newId, fMemoryManager);
00469 }
00470 
00471 inline void XMLEntityDecl::setBaseURI(const XMLCh* const newId)
00472 {
00473     if (fBaseURI)
00474         fMemoryManager->deallocate(fBaseURI);
00475 
00476     fBaseURI = XMLString::replicate(newId, fMemoryManager);
00477 }
00478 
00479 inline void XMLEntityDecl::setValue(const XMLCh* const newValue)
00480 {
00481     if (fValue)
00482         fMemoryManager->deallocate(fValue);
00483 
00484     fValue = XMLString::replicate(newValue, fMemoryManager);
00485     fValueLen = XMLString::stringLen(newValue);
00486 }
00487 
00488 
00489 
00490 
00491 
00492 inline const XMLCh* XMLEntityDecl::getKey() const
00493 {
00494     return fName;
00495 }
00496 
00497 XERCES_CPP_NAMESPACE_END
00498 
00499 #endif