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 #if !defined(XMLATTR_HPP)
00095 #define XMLATTR_HPP
00096
00097 #include <util/XMLString.hpp>
00098 #include <util/QName.hpp>
00099 #include <framework/XMLAttDef.hpp>
00100
00101
00123 class XMLAttr
00124 {
00125 public:
00126
00127
00128
00131
00137 XMLAttr();
00138
00165 XMLAttr
00166 (
00167 const unsigned int uriId
00168 , const XMLCh* const attrName
00169 , const XMLCh* const attrPrefix
00170 , const XMLCh* const attrValue
00171 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00172 , const bool specified = true
00173 );
00175
00178 ~XMLAttr();
00180
00181
00182
00183
00184
00185
00188
00192 QName* getAttName() const;
00193
00198 const XMLCh* getName() const;
00199
00204 const XMLCh* getPrefix() const;
00205
00211 const XMLCh* getQName() const;
00212
00217 bool getSpecified() const;
00218
00223 XMLAttDef::AttTypes getType() const;
00224
00230 const XMLCh* getValue() const;
00231
00236 unsigned int getURIId() const;
00237
00239
00240
00241
00242
00243
00244
00247
00275 void set
00276 (
00277 const unsigned int uriId
00278 , const XMLCh* const attrName
00279 , const XMLCh* const attrPrefix
00280 , const XMLCh* const attrValue
00281 , const XMLAttDef::AttTypes type = XMLAttDef::CData
00282 );
00283
00298 void setName
00299 (
00300 const unsigned int uriId
00301 , const XMLCh* const attrName
00302 , const XMLCh* const attrPrefix
00303 );
00304
00312 void setSpecified(const bool newValue);
00313
00322 void setType(const XMLAttDef::AttTypes newType);
00323
00331 void setValue(const XMLCh* const newValue);
00332
00338 void setURIId(const unsigned int uriId);
00339
00341
00342
00343
00344 private :
00345
00346
00347
00348 XMLAttr(const XMLAttr&);
00349 XMLAttr& operator=(const XMLAttr&);
00350
00351
00352
00353
00354
00355 void cleanUp();
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378 bool fSpecified;
00379 XMLAttDef::AttTypes fType;
00380 XMLCh* fValue;
00381 unsigned int fValueBufSz;
00382 QName* fAttName;
00383 };
00384
00385
00386
00387
00388 inline XMLAttr::~XMLAttr()
00389 {
00390 cleanUp();
00391 }
00392
00393
00394
00395
00396
00397 inline QName* XMLAttr::getAttName() const
00398 {
00399 return fAttName;
00400 }
00401
00402 inline const XMLCh* XMLAttr::getName() const
00403 {
00404 return fAttName->getLocalPart();
00405 }
00406
00407 inline const XMLCh* XMLAttr::getPrefix() const
00408 {
00409 return fAttName->getPrefix();
00410 }
00411
00412 inline bool XMLAttr::getSpecified() const
00413 {
00414 return fSpecified;
00415 }
00416
00417 inline XMLAttDef::AttTypes XMLAttr::getType() const
00418 {
00419 return fType;
00420 }
00421
00422 inline const XMLCh* XMLAttr::getValue() const
00423 {
00424 return fValue;
00425 }
00426
00427 inline unsigned int XMLAttr::getURIId() const
00428 {
00429 return fAttName->getURI();
00430 }
00431
00432
00433
00434
00435
00436 inline void XMLAttr::set(const unsigned int uriId
00437 , const XMLCh* const attrName
00438 , const XMLCh* const attrPrefix
00439 , const XMLCh* const attrValue
00440 , const XMLAttDef::AttTypes type)
00441 {
00442
00443 fAttName->setName(attrPrefix, attrName, uriId);
00444 setValue(attrValue);
00445
00446
00447 fType = type;
00448 }
00449
00450 inline void XMLAttr::setType(const XMLAttDef::AttTypes newValue)
00451 {
00452 fType = newValue;
00453 }
00454
00455 inline void XMLAttr::setSpecified(const bool newValue)
00456 {
00457 fSpecified = newValue;
00458 }
00459
00460 #endif