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_XMLATTR_HPP)
00023 #define XERCESC_INCLUDE_GUARD_XMLATTR_HPP
00024
00025 #include <xercesc/util/PlatformUtils.hpp>
00026 #include <xercesc/util/QName.hpp>
00027 #include <xercesc/framework/XMLAttDef.hpp>
00028 #include <xercesc/validators/datatype/DatatypeValidator.hpp>
00029
00030 XERCES_CPP_NAMESPACE_BEGIN
00031
00053 class XMLPARSER_EXPORT XMLAttr : public XMemory
00054 {
00055 public:
00056
00057
00058
00061
00069 XMLAttr(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00070
00103 XMLAttr
00104 (
00105 const unsigned int uriId
00106 , const XMLCh* const attrName
00107 , const XMLCh* const attrPrefix
00108 , const XMLCh* const attrValue
00109 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00110 , const bool specified = true
00111 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00112 , DatatypeValidator * datatypeValidator = 0
00113 , const bool isSchema = false
00114 );
00115
00144 XMLAttr
00145 (
00146 const unsigned int uriId
00147 , const XMLCh* const rawName
00148 , const XMLCh* const attrValue
00149 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00150 , const bool specified = true
00151 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00152 , DatatypeValidator * datatypeValidator = 0
00153 , const bool isSchema = false
00154 );
00155
00157
00160 ~XMLAttr();
00162
00163
00164
00165
00166
00167
00170
00174 QName* getAttName() const;
00175
00180 const XMLCh* getName() const;
00181
00186 const XMLCh* getPrefix() const;
00187
00193 const XMLCh* getQName() const;
00194
00199 bool getSpecified() const;
00200
00205 XMLAttDef::AttTypes getType() const;
00206
00212 const XMLCh* getValue() const;
00213
00218 unsigned int getURIId() const;
00219
00221
00222
00223
00224
00225
00226
00229
00258 void set
00259 (
00260 const unsigned int uriId
00261 , const XMLCh* const attrName
00262 , const XMLCh* const attrPrefix
00263 , const XMLCh* const attrValue
00264 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00265 , DatatypeValidator * datatypeValidator = 0
00266 , const bool isSchema = false
00267 );
00268
00292 void set
00293 (
00294 const unsigned int uriId
00295 , const XMLCh* const attrRawName
00296 , const XMLCh* const attrValue
00297 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00298 , DatatypeValidator * datatypeValidator = 0
00299 , const bool isSchema = false
00300 );
00301
00316 void setName
00317 (
00318 const unsigned int uriId
00319 , const XMLCh* const attrName
00320 , const XMLCh* const attrPrefix
00321 );
00322
00330 void setSpecified(const bool newValue);
00331
00340 void setType(const XMLAttDef::AttTypes newType);
00341
00349 void setValue(const XMLCh* const newValue);
00350
00358 void setURIId(const unsigned int uriId);
00359
00361
00362
00363
00364 private :
00365
00366
00367
00368 XMLAttr(const XMLAttr&);
00369 XMLAttr& operator=(const XMLAttr&);
00370
00371
00372
00373
00374
00375 void cleanUp();
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400 bool fSpecified;
00401 XMLAttDef::AttTypes fType;
00402 XMLSize_t fValueBufSz;
00403 XMLCh* fValue;
00404 QName* fAttName;
00405 MemoryManager* fMemoryManager;
00406 };
00407
00408
00409
00410
00411 inline XMLAttr::~XMLAttr()
00412 {
00413 cleanUp();
00414 }
00415
00416
00417
00418
00419
00420 inline QName* XMLAttr::getAttName() const
00421 {
00422 return fAttName;
00423 }
00424
00425 inline const XMLCh* XMLAttr::getName() const
00426 {
00427 return fAttName->getLocalPart();
00428 }
00429
00430 inline const XMLCh* XMLAttr::getPrefix() const
00431 {
00432 return fAttName->getPrefix();
00433 }
00434
00435 inline bool XMLAttr::getSpecified() const
00436 {
00437 return fSpecified;
00438 }
00439
00440 inline XMLAttDef::AttTypes XMLAttr::getType() const
00441 {
00442 return fType;
00443 }
00444
00445 inline const XMLCh* XMLAttr::getValue() const
00446 {
00447 return fValue;
00448 }
00449
00450 inline unsigned int XMLAttr::getURIId() const
00451 {
00452 return fAttName->getURI();
00453 }
00454
00455
00456
00457
00458 inline void XMLAttr::set(const unsigned int uriId
00459 , const XMLCh* const attrName
00460 , const XMLCh* const attrPrefix
00461 , const XMLCh* const attrValue
00462 , const XMLAttDef::AttTypes type
00463 , DatatypeValidator *
00464 , const bool )
00465 {
00466
00467 fAttName->setName(attrPrefix, attrName, uriId);
00468 setValue(attrValue);
00469
00470
00471 fType = type;
00472 }
00473
00474 inline void XMLAttr::set(const unsigned int uriId
00475 , const XMLCh* const attrRawName
00476 , const XMLCh* const attrValue
00477 , const XMLAttDef::AttTypes type
00478 , DatatypeValidator *
00479 , const bool )
00480 {
00481
00482 fAttName->setName(attrRawName, uriId);
00483 setValue(attrValue);
00484
00485
00486 fType = type;
00487 }
00488
00489 inline void XMLAttr::setType(const XMLAttDef::AttTypes newValue)
00490 {
00491 fType = newValue;
00492 }
00493
00494 inline void XMLAttr::setSpecified(const bool newValue)
00495 {
00496 fSpecified = newValue;
00497 }
00498
00499 XERCES_CPP_NAMESPACE_END
00500
00501 #endif