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
00110
00111
00112
00113
00114
00115 #if !defined(XMLATTR_HPP)
00116 #define XMLATTR_HPP
00117
00118 #include <xercesc/util/PlatformUtils.hpp>
00119 #include <xercesc/util/QName.hpp>
00120 #include <xercesc/framework/XMLAttDef.hpp>
00121
00122 XERCES_CPP_NAMESPACE_BEGIN
00123
00145 class XMLAttr : public XMemory
00146 {
00147 public:
00148
00149
00150
00153
00161 XMLAttr(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00162
00191 XMLAttr
00192 (
00193 const unsigned int uriId
00194 , const XMLCh* const attrName
00195 , const XMLCh* const attrPrefix
00196 , const XMLCh* const attrValue
00197 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00198 , const bool specified = true
00199 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00200 );
00201
00226 XMLAttr
00227 (
00228 const unsigned int uriId
00229 , const XMLCh* const rawName
00230 , const XMLCh* const attrValue
00231 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00232 , const bool specified = true
00233 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00234 );
00235
00237
00240 ~XMLAttr();
00242
00243
00244
00245
00246
00247
00250
00254 QName* getAttName() const;
00255
00260 const XMLCh* getName() const;
00261
00266 const XMLCh* getPrefix() const;
00267
00273 const XMLCh* getQName() const;
00274
00279 bool getSpecified() const;
00280
00285 XMLAttDef::AttTypes getType() const;
00286
00292 const XMLCh* getValue() const;
00293
00298 unsigned int getURIId() const;
00299
00301
00302
00303
00304
00305
00306
00309
00334 void set
00335 (
00336 const unsigned int uriId
00337 , const XMLCh* const attrName
00338 , const XMLCh* const attrPrefix
00339 , const XMLCh* const attrValue
00340 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00341 );
00342
00363 void set
00364 (
00365 const unsigned int uriId
00366 , const XMLCh* const attrRawName
00367 , const XMLCh* const attrValue
00368 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00369 );
00370
00385 void setName
00386 (
00387 const unsigned int uriId
00388 , const XMLCh* const attrName
00389 , const XMLCh* const attrPrefix
00390 );
00391
00399 void setSpecified(const bool newValue);
00400
00409 void setType(const XMLAttDef::AttTypes newType);
00410
00418 void setValue(const XMLCh* const newValue);
00419
00427 void setURIId(const unsigned int uriId);
00428
00430
00431
00432
00433 private :
00434
00435
00436
00437 XMLAttr(const XMLAttr&);
00438 XMLAttr& operator=(const XMLAttr&);
00439
00440
00441
00442
00443
00444 void cleanUp();
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470 bool fSpecified;
00471 XMLAttDef::AttTypes fType;
00472 unsigned int fValueBufSz;
00473 XMLCh* fValue;
00474 QName* fAttName;
00475 MemoryManager* fMemoryManager;
00476 };
00477
00478
00479
00480
00481 inline XMLAttr::~XMLAttr()
00482 {
00483 cleanUp();
00484 }
00485
00486
00487
00488
00489
00490 inline QName* XMLAttr::getAttName() const
00491 {
00492 return fAttName;
00493 }
00494
00495 inline const XMLCh* XMLAttr::getName() const
00496 {
00497 return fAttName->getLocalPart();
00498 }
00499
00500 inline const XMLCh* XMLAttr::getPrefix() const
00501 {
00502 return fAttName->getPrefix();
00503 }
00504
00505 inline bool XMLAttr::getSpecified() const
00506 {
00507 return fSpecified;
00508 }
00509
00510 inline XMLAttDef::AttTypes XMLAttr::getType() const
00511 {
00512 return fType;
00513 }
00514
00515 inline const XMLCh* XMLAttr::getValue() const
00516 {
00517 return fValue;
00518 }
00519
00520 inline unsigned int XMLAttr::getURIId() const
00521 {
00522 return fAttName->getURI();
00523 }
00524
00525
00526
00527
00528
00529 inline void XMLAttr::set(const unsigned int uriId
00530 , const XMLCh* const attrName
00531 , const XMLCh* const attrPrefix
00532 , const XMLCh* const attrValue
00533 , const XMLAttDef::AttTypes type)
00534 {
00535
00536 fAttName->setName(attrPrefix, attrName, uriId);
00537 setValue(attrValue);
00538
00539
00540 fType = type;
00541 }
00542
00543 inline void XMLAttr::set(const unsigned int uriId
00544 , const XMLCh* const attrRawName
00545 , const XMLCh* const attrValue
00546 , const XMLAttDef::AttTypes type)
00547 {
00548
00549 fAttName->setName(attrRawName, uriId);
00550 setValue(attrValue);
00551
00552
00553 fType = type;
00554 }
00555
00556 inline void XMLAttr::setType(const XMLAttDef::AttTypes newValue)
00557 {
00558 fType = newValue;
00559 }
00560
00561 inline void XMLAttr::setSpecified(const bool newValue)
00562 {
00563 fSpecified = newValue;
00564 }
00565
00566 XERCES_CPP_NAMESPACE_END
00567
00568 #endif