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 #if !defined(XMLATTR_HPP)
00101 #define XMLATTR_HPP
00102
00103 #include <xercesc/util/XMLString.hpp>
00104 #include <xercesc/util/QName.hpp>
00105 #include <xercesc/framework/XMLAttDef.hpp>
00106
00107
00129 class XMLAttr
00130 {
00131 public:
00132
00133
00134
00137
00143 XMLAttr();
00144
00171 XMLAttr
00172 (
00173 const unsigned int uriId
00174 , const XMLCh* const attrName
00175 , const XMLCh* const attrPrefix
00176 , const XMLCh* const attrValue
00177 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00178 , const bool specified = true
00179 );
00181
00184 ~XMLAttr();
00186
00187
00188
00189
00190
00191
00194
00198 QName* getAttName() const;
00199
00204 const XMLCh* getName() const;
00205
00210 const XMLCh* getPrefix() const;
00211
00217 const XMLCh* getQName() const;
00218
00223 bool getSpecified() const;
00224
00229 XMLAttDef::AttTypes getType() const;
00230
00236 const XMLCh* getValue() const;
00237
00242 unsigned int getURIId() const;
00243
00245
00246
00247
00248
00249
00250
00253
00278 void set
00279 (
00280 const unsigned int uriId
00281 , const XMLCh* const attrName
00282 , const XMLCh* const attrPrefix
00283 , const XMLCh* const attrValue
00284 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00285 );
00286
00301 void setName
00302 (
00303 const unsigned int uriId
00304 , const XMLCh* const attrName
00305 , const XMLCh* const attrPrefix
00306 );
00307
00315 void setSpecified(const bool newValue);
00316
00325 void setType(const XMLAttDef::AttTypes newType);
00326
00334 void setValue(const XMLCh* const newValue);
00335
00343 void setURIId(const unsigned int uriId);
00344
00346
00347
00348
00349 private :
00350
00351
00352
00353 XMLAttr(const XMLAttr&);
00354 XMLAttr& operator=(const XMLAttr&);
00355
00356
00357
00358
00359
00360 void cleanUp();
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383 bool fSpecified;
00384 XMLAttDef::AttTypes fType;
00385 XMLCh* fValue;
00386 unsigned int fValueBufSz;
00387 QName* fAttName;
00388 };
00389
00390
00391
00392
00393 inline XMLAttr::~XMLAttr()
00394 {
00395 cleanUp();
00396 }
00397
00398
00399
00400
00401
00402 inline QName* XMLAttr::getAttName() const
00403 {
00404 return fAttName;
00405 }
00406
00407 inline const XMLCh* XMLAttr::getName() const
00408 {
00409 return fAttName->getLocalPart();
00410 }
00411
00412 inline const XMLCh* XMLAttr::getPrefix() const
00413 {
00414 return fAttName->getPrefix();
00415 }
00416
00417 inline bool XMLAttr::getSpecified() const
00418 {
00419 return fSpecified;
00420 }
00421
00422 inline XMLAttDef::AttTypes XMLAttr::getType() const
00423 {
00424 return fType;
00425 }
00426
00427 inline const XMLCh* XMLAttr::getValue() const
00428 {
00429 return fValue;
00430 }
00431
00432 inline unsigned int XMLAttr::getURIId() const
00433 {
00434 return fAttName->getURI();
00435 }
00436
00437
00438
00439
00440
00441 inline void XMLAttr::set(const unsigned int uriId
00442 , const XMLCh* const attrName
00443 , const XMLCh* const attrPrefix
00444 , const XMLCh* const attrValue
00445 , const XMLAttDef::AttTypes type)
00446 {
00447
00448 fAttName->setName(attrPrefix, attrName, uriId);
00449 setValue(attrValue);
00450
00451
00452 fType = type;
00453 }
00454
00455 inline void XMLAttr::setType(const XMLAttDef::AttTypes newValue)
00456 {
00457 fType = newValue;
00458 }
00459
00460 inline void XMLAttr::setSpecified(const bool newValue)
00461 {
00462 fSpecified = newValue;
00463 }
00464
00465 #endif