File indexing completed on 2025-01-30 10:27:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #if !defined(XERCESC_INCLUDE_GUARD_DOMATTRIMPL_HPP)
0023 #define XERCESC_INCLUDE_GUARD_DOMATTRIMPL_HPP
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #include <xercesc/util/XercesDefs.hpp>
0036 #include "DOMNodeBase.hpp"
0037 #include "DOMParentNode.hpp"
0038 #include "DOMNodeImpl.hpp"
0039 #include "DOMDocumentImpl.hpp"
0040 #include <xercesc/dom/DOMAttr.hpp>
0041 #include <xercesc/framework/XMLBuffer.hpp>
0042 #include "DOMNodeIDMap.hpp"
0043
0044 XERCES_CPP_NAMESPACE_BEGIN
0045
0046 class DOMElementImpl;
0047 class DOMTypeInfoImpl;
0048
0049 class CDOM_EXPORT DOMAttrImpl: public DOMAttr, public HasDOMNodeImpl, public HasDOMParentImpl {
0050
0051 public:
0052 DOMNodeImpl fNode;
0053 DOMParentNode fParent;
0054 const XMLCh *fName;
0055
0056 protected:
0057 const DOMTypeInfoImpl *fSchemaType;
0058
0059 public:
0060 DOMAttrImpl(DOMDocument *ownerDocument, const XMLCh *aName);
0061 DOMAttrImpl(const DOMAttrImpl &other, bool deep=false);
0062 virtual ~DOMAttrImpl();
0063
0064 public:
0065
0066 DOMNODE_FUNCTIONS;
0067
0068
0069 DOMNODEIMPL_DECL;
0070 DOMPARENTIMPL_DECL;
0071
0072 public:
0073 virtual const XMLCh * getName() const;
0074 virtual bool getSpecified() const;
0075 virtual const XMLCh * getValue() const;
0076 virtual void setSpecified(bool arg);
0077 virtual void setValue(const XMLCh * value);
0078 virtual DOMElement * getOwnerElement() const;
0079 virtual bool isId() const;
0080 virtual const DOMTypeInfo* getSchemaTypeInfo() const;
0081
0082 void setOwnerElement(DOMElement *ownerElem);
0083
0084
0085 virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
0086
0087
0088 virtual void setSchemaTypeInfo(const DOMTypeInfoImpl* typeInfo);
0089
0090
0091 virtual void addAttrToIDNodeMap();
0092
0093
0094 virtual void removeAttrFromIDNodeMap();
0095
0096 public:
0097
0098
0099
0100
0101
0102
0103 virtual void setValueFast (const XMLCh * value);
0104
0105 protected:
0106 void getTextValue(DOMNode* node, XMLBuffer& buf) const;
0107
0108 private:
0109
0110
0111
0112 DOMAttrImpl& operator=(const DOMAttrImpl&);
0113 };
0114
0115 inline void DOMAttrImpl::removeAttrFromIDNodeMap()
0116 {
0117 if (fNode.isIdAttr()) {
0118 ((DOMDocumentImpl *)fParent.fOwnerDocument)->getNodeIDMap()->remove(this);
0119 fNode.isIdAttr(false);
0120 }
0121 }
0122
0123 inline void DOMAttrImpl::addAttrToIDNodeMap()
0124 {
0125 if (fNode.isIdAttr())
0126 return;
0127
0128 fNode.isIdAttr(true);
0129
0130
0131
0132 DOMDocumentImpl *doc = (DOMDocumentImpl *)(fParent.fOwnerDocument);
0133
0134 if (doc->fNodeIDMap == 0)
0135 doc->fNodeIDMap = new (doc) DOMNodeIDMap(500, doc);
0136
0137 doc->getNodeIDMap()->add(this);
0138 }
0139
0140 XERCES_CPP_NAMESPACE_END
0141
0142 #endif