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 #if !defined(XMLATTR_HPP)
00092 #define XMLATTR_HPP
00093 
00094 #include <util/XMLString.hpp>
00095 #include <util/QName.hpp>
00096 #include <framework/XMLAttDef.hpp>
00097 
00098 
00120 class  XMLAttr
00121 {
00122 public:
00123     
00124     
00125     
00128 
00134     XMLAttr();
00135 
00162     XMLAttr
00163     (
00164         const   unsigned int        uriId
00165         , const XMLCh* const        attrName
00166         , const XMLCh* const        attrPrefix
00167         , const XMLCh* const        attrValue
00168         , const XMLAttDef::AttTypes type = XMLAttDef::CData
00169         , const bool                specified = true
00170     );
00172 
00175     ~XMLAttr();
00177 
00178 
00179     
00180     
00181     
00182 
00185 
00190     const XMLCh* getName() const;
00191 
00196     const XMLCh* getPrefix() const;
00197 
00203     const XMLCh* getQName() const;
00204 
00209     bool getSpecified() const;
00210 
00215     XMLAttDef::AttTypes getType() const;
00216 
00222     const XMLCh* getValue() const;
00223 
00228     unsigned int getURIId() const;
00229 
00231 
00232 
00233     
00234     
00235     
00236 
00239 
00267     void set
00268     (
00269         const   unsigned int        uriId
00270         , const XMLCh* const        attrName
00271         , const XMLCh* const        attrPrefix
00272         , const XMLCh* const        attrValue
00273         , const XMLAttDef::AttTypes type = XMLAttDef::CData
00274     );
00275 
00290     void setName
00291     (
00292         const   unsigned int        uriId
00293         , const XMLCh* const        attrName
00294         , const XMLCh* const        attrPrefix
00295     );
00296 
00304     void setSpecified(const bool newValue);
00305 
00314     void setType(const XMLAttDef::AttTypes newType);
00315 
00323     void setValue(const XMLCh* const newValue);
00324 
00330     void setURIId(const unsigned int uriId);
00331 
00333 
00334 
00335 
00336 private :
00337     
00338     
00339     
00340     XMLAttr(const XMLAttr&);
00341     XMLAttr& operator=(const XMLAttr&);
00342 
00343 
00344     
00345     
00346     
00347     void cleanUp();
00348 
00349 
00350     
00351     
00352     
00353     
00354     
00355     
00356     
00357     
00358     
00359     
00360     
00361     
00362     
00363     
00364     
00365     
00366     
00367     
00368     
00369     
00370     bool                fSpecified;
00371     XMLAttDef::AttTypes fType;
00372     XMLCh*              fValue;
00373     unsigned int        fValueBufSz;
00374     QName*              fAttName;
00375 };
00376 
00377 
00378 
00379 
00380 inline XMLAttr::~XMLAttr()
00381 {
00382     cleanUp();
00383 }
00384 
00385 
00386 
00387 
00388 
00389 inline const XMLCh* XMLAttr::getName() const
00390 {
00391     return fAttName->getLocalPart();
00392 }
00393 
00394 inline const XMLCh* XMLAttr::getPrefix() const
00395 {
00396     return fAttName->getPrefix();
00397 }
00398 
00399 inline bool XMLAttr::getSpecified() const
00400 {
00401     return fSpecified;
00402 }
00403 
00404 inline XMLAttDef::AttTypes XMLAttr::getType() const
00405 {
00406     return fType;
00407 }
00408 
00409 inline const XMLCh* XMLAttr::getValue() const
00410 {
00411     return fValue;
00412 }
00413 
00414 inline unsigned int XMLAttr::getURIId() const
00415 {
00416     return fAttName->getURI();
00417 }
00418 
00419 
00420 
00421 
00422 
00423 inline void XMLAttr::set(const  unsigned int        uriId
00424                         , const XMLCh* const        attrName
00425                         , const XMLCh* const        attrPrefix
00426                         , const XMLCh* const        attrValue
00427                         , const XMLAttDef::AttTypes type)
00428 {
00429     
00430     fAttName->setName(attrPrefix, attrName, uriId);
00431     setValue(attrValue);
00432 
00433     
00434     fType = type;
00435 }
00436 
00437 inline void XMLAttr::setType(const XMLAttDef::AttTypes newValue)
00438 {
00439     fType = newValue;
00440 }
00441 
00442 inline void XMLAttr::setSpecified(const bool newValue)
00443 {
00444     fSpecified = newValue;
00445 }
00446 
00447 #endif