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_QNAME_HPP)
00023 #define XERCESC_INCLUDE_GUARD_QNAME_HPP
00024
00025 #include <xercesc/util/XMLString.hpp>
00026 #include <xercesc/util/XMLUniDefs.hpp>
00027 #include <xercesc/util/XMemory.hpp>
00028 #include <xercesc/util/PlatformUtils.hpp>
00029
00030 #include <xercesc/internal/XSerializable.hpp>
00031
00032 XERCES_CPP_NAMESPACE_BEGIN
00033
00034 class XMLUTIL_EXPORT QName : public XSerializable, public XMemory
00035 {
00036 public :
00037
00038
00039
00041 QName(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00042
00044 QName
00045 (
00046 const XMLCh* const prefix
00047 , const XMLCh* const localPart
00048 , const unsigned int uriId
00049 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00050 );
00051
00053 QName
00054 (
00055 const XMLCh* const rawName
00056 , const unsigned int uriId
00057 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00058 );
00059
00061 QName(const QName& qname);
00062
00063 ~QName();
00064
00065
00066
00067
00068 const XMLCh* getPrefix() const;
00069 XMLCh* getPrefix();
00070
00071 const XMLCh* getLocalPart() const;
00072 XMLCh* getLocalPart();
00073
00074 unsigned int getURI() const;
00075
00076 const XMLCh* getRawName() const;
00077 XMLCh* getRawName();
00078
00079 MemoryManager* getMemoryManager() const;
00080
00081
00082
00083
00084 void setName
00085 (
00086 const XMLCh* const prefix
00087 , const XMLCh* const localPart
00088 , const unsigned int uriId
00089 );
00090
00091 void setName
00092 (
00093 const XMLCh* const rawName
00094 , const unsigned int uriId
00095 );
00096
00097 void setPrefix(const XMLCh*) ;
00098 void setLocalPart(const XMLCh*) ;
00099 void setNPrefix(const XMLCh*, const XMLSize_t ) ;
00100 void setNLocalPart(const XMLCh*, const XMLSize_t ) ;
00101 void setURI(const unsigned int) ;
00102
00103 void setValues(const QName& qname);
00104
00105
00106
00107
00108 bool operator==(const QName&) const;
00109
00110
00111
00112
00113 void cleanUp();
00114
00115
00116
00117
00118 DECL_XSERIALIZABLE(QName)
00119
00120 private :
00121
00122
00123
00124 QName& operator=(const QName&);
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 XMLSize_t fPrefixBufSz;
00155 XMLSize_t fLocalPartBufSz;
00156 XMLSize_t fRawNameBufSz;
00157 unsigned int fURIId;
00158 XMLCh* fPrefix;
00159 XMLCh* fLocalPart;
00160 XMLCh* fRawName;
00161 MemoryManager* fMemoryManager;
00162 };
00163
00164
00165
00166
00167 inline const XMLCh* QName::getPrefix() const
00168 {
00169 return fPrefix;
00170 }
00171
00172 inline XMLCh* QName::getPrefix()
00173 {
00174 return fPrefix;
00175 }
00176
00177 inline const XMLCh* QName::getLocalPart() const
00178 {
00179 return fLocalPart;
00180 }
00181
00182 inline XMLCh* QName::getLocalPart()
00183 {
00184 return fLocalPart;
00185 }
00186
00187 inline unsigned int QName::getURI() const
00188 {
00189 return fURIId;
00190 }
00191
00192 inline MemoryManager* QName::getMemoryManager() const
00193 {
00194 return fMemoryManager;
00195 }
00196
00197
00198
00199
00200 inline void QName::setURI(const unsigned int uriId)
00201 {
00202 fURIId = uriId;
00203 }
00204
00205 inline void QName::setPrefix(const XMLCh* prefix)
00206 {
00207 setNPrefix(prefix, XMLString::stringLen(prefix));
00208 }
00209
00210 inline void QName::setLocalPart(const XMLCh* localPart)
00211 {
00212 setNLocalPart(localPart, XMLString::stringLen(localPart));
00213 }
00214
00215 XERCES_CPP_NAMESPACE_END
00216
00217 #endif