File indexing completed on 2025-01-30 10:27:02
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_DOMNODEIMPL_HPP)
0023 #define XERCESC_INCLUDE_GUARD_DOMNODEIMPL_HPP
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 #include <xercesc/util/XercesDefs.hpp>
0053 #include <xercesc/dom/DOMUserDataHandler.hpp>
0054
0055 XERCES_CPP_NAMESPACE_BEGIN
0056
0057
0058 class DOMNamedNodeMap;
0059 class DOMNodeList;
0060 class DOMNode;
0061 class DOMDocument;
0062 class DOMElement;
0063
0064 class CDOM_EXPORT DOMNodeImpl {
0065 public:
0066
0067
0068 DOMNode *fContainingNode;
0069 DOMNode *fOwnerNode;
0070
0071 unsigned short flags;
0072
0073 static const unsigned short READONLY;
0074 static const unsigned short SYNCDATA;
0075 static const unsigned short SYNCCHILDREN;
0076 static const unsigned short OWNED;
0077 static const unsigned short FIRSTCHILD;
0078 static const unsigned short SPECIFIED;
0079 static const unsigned short IGNORABLEWS;
0080 static const unsigned short SETVALUE;
0081 static const unsigned short ID_ATTR;
0082 static const unsigned short USERDATA;
0083 static const unsigned short LEAFNODETYPE;
0084 static const unsigned short CHILDNODE;
0085 static const unsigned short TOBERELEASED;
0086
0087
0088 public:
0089 DOMNodeImpl(DOMNode* containingNode, DOMNode *ownerDocument);
0090 DOMNodeImpl(DOMNode* containingNode, const DOMNodeImpl &other);
0091 ~DOMNodeImpl();
0092
0093 private:
0094
0095 DOMNodeImpl(const DOMNodeImpl &other);
0096
0097 DOMNode* getContainingNode();
0098 const DOMNode* getContainingNode() const;
0099
0100 public:
0101 DOMNode * appendChild(DOMNode *newChild);
0102 DOMNamedNodeMap * getAttributes() const;
0103 DOMNodeList * getChildNodes() const;
0104 DOMNode * getFirstChild() const;
0105 DOMNode * getLastChild() const;
0106 const XMLCh * getLocalName() const;
0107 const XMLCh * getNamespaceURI() const;
0108 DOMNode * getNextSibling() const;
0109 const XMLCh * getNodeValue() const;
0110 DOMDocument * getOwnerDocument() const;
0111 DOMNode * getParentNode() const;
0112 const XMLCh * getPrefix() const;
0113 DOMNode * getPreviousSibling() const;
0114 bool hasChildNodes() const;
0115 DOMNode * insertBefore(DOMNode *newChild, DOMNode *refChild);
0116 void normalize();
0117 DOMNode * removeChild(DOMNode *oldChild);
0118 DOMNode * replaceChild(DOMNode *newChild, DOMNode *oldChild);
0119 void setNodeValue(const XMLCh *value);
0120 void setPrefix(const XMLCh *fPrefix);
0121 void setReadOnly(bool readOnly, bool deep);
0122 bool isSupported(const XMLCh *feature, const XMLCh *version) const;
0123 bool hasAttributes() const;
0124
0125
0126 void* setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler);
0127 void* getUserData(const XMLCh* key) const;
0128 bool isSameNode(const DOMNode* other) const;
0129 bool isEqualNode(const DOMNode* arg) const;
0130 const XMLCh* getBaseURI() const ;
0131 short compareDocumentPosition(const DOMNode* other) const;
0132 const XMLCh* getTextContent() const ;
0133 const XMLCh* getTextContent(XMLCh* pzBuffer, XMLSize_t& rnBufferLength) const;
0134 void setTextContent(const XMLCh* textContent) ;
0135 const XMLCh* lookupPrefix(const XMLCh* namespaceURI) const ;
0136 bool isDefaultNamespace(const XMLCh* namespaceURI) const ;
0137 const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const ;
0138 void* getFeature(const XMLCh* feature, const XMLCh* version) const;
0139
0140
0141
0142 void release();
0143 void callUserDataHandlers(DOMUserDataHandler::DOMOperationType operation,
0144 const DOMNode* src,
0145 DOMNode* dst) const;
0146
0147 short reverseTreeOrderBitPattern(short pattern) const;
0148 const DOMNode* getTreeParentNode(const DOMNode* node) const;
0149
0150
0151
0152 static bool isKidOK(DOMNode *parent, DOMNode *child);
0153 static const XMLCh *mapPrefix(const XMLCh *prefix,
0154 const XMLCh *namespaceURI, short nType);
0155
0156 static const XMLCh *getXmlnsString();
0157 static const XMLCh *getXmlnsURIString();
0158 static const XMLCh *getXmlString();
0159 static const XMLCh *getXmlURIString();
0160
0161 public:
0162
0163 DOMNode* getElementAncestor (const DOMNode* currentNode) const;
0164 const XMLCh* lookupPrefix(const XMLCh* const namespaceURI, DOMElement *el) const ;
0165 void setOwnerDocument(DOMDocument *doc);
0166
0167
0168
0169
0170
0171 inline bool isReadOnly() const {
0172 return (flags & READONLY) != 0;
0173 }
0174
0175 inline void isReadOnly(bool value) {
0176 flags = (value ? flags | READONLY : flags & ~READONLY);
0177 }
0178
0179 inline bool needsSyncData() const {
0180 return (flags & SYNCDATA) != 0;
0181 }
0182
0183 inline void needsSyncData(bool value) {
0184 flags = (value ? flags | SYNCDATA : flags & ~SYNCDATA);
0185 }
0186
0187 inline bool needsSyncChildren() const {
0188 return (flags & SYNCCHILDREN) != 0;
0189 }
0190
0191 inline void needsSyncChildren(bool value) {
0192 flags = (value ? flags | SYNCCHILDREN : flags & ~SYNCCHILDREN);
0193 }
0194
0195
0196
0197 inline bool isOwned() const {
0198 return (flags & OWNED) != 0;
0199 }
0200
0201 inline void isOwned(bool value) {
0202 flags = (value ? flags | OWNED : flags & ~OWNED);
0203 }
0204
0205 inline bool isFirstChild() const {
0206 return (flags & FIRSTCHILD) != 0;
0207 }
0208
0209 inline void isFirstChild(bool value) {
0210 flags = (value ? flags | FIRSTCHILD : flags & ~FIRSTCHILD);
0211 }
0212
0213 inline bool isSpecified() const {
0214 return (flags & SPECIFIED) != 0;
0215 }
0216
0217 inline void isSpecified(bool value) {
0218 flags = (value ? flags | SPECIFIED : flags & ~SPECIFIED);
0219 }
0220
0221 inline bool ignorableWhitespace() const {
0222 return (flags & IGNORABLEWS) != 0;
0223 }
0224
0225 inline void ignorableWhitespace(bool value) {
0226 flags = (value ? flags | IGNORABLEWS : flags & ~IGNORABLEWS);
0227 }
0228
0229 inline bool setValue() const {
0230 return (flags & SETVALUE) != 0;
0231 }
0232
0233 inline void setValue(bool value) {
0234 flags = (value ? flags | SETVALUE : flags & ~SETVALUE);
0235 }
0236
0237 inline bool isIdAttr() const {
0238 return (flags & ID_ATTR) != 0;
0239 }
0240
0241 inline void isIdAttr(bool value) {
0242 flags = (value ? flags | ID_ATTR : flags & ~ID_ATTR);
0243 }
0244
0245 inline bool hasUserData() const {
0246 return (flags & USERDATA) != 0;
0247 }
0248
0249 inline void hasUserData(bool value) {
0250 flags = (value ? flags | USERDATA : flags & ~USERDATA);
0251 }
0252
0253
0254
0255
0256
0257
0258 inline bool isLeafNode() const {
0259 return (flags & LEAFNODETYPE) != 0;
0260 }
0261
0262 inline void setIsLeafNode(bool value) {
0263 flags = (value ? flags | LEAFNODETYPE : flags & ~LEAFNODETYPE);
0264 }
0265
0266
0267
0268
0269
0270
0271
0272 inline bool isChildNode() const {
0273 return (flags & CHILDNODE) != 0;
0274 }
0275
0276 inline void setIsChildNode(bool value) {
0277 flags = (value ? flags | CHILDNODE : flags & ~CHILDNODE);
0278 }
0279
0280
0281
0282 inline bool isToBeReleased() const {
0283 return (flags & TOBERELEASED) != 0;
0284 }
0285
0286 inline void isToBeReleased(bool value) {
0287 flags = (value ? flags | TOBERELEASED : flags & ~TOBERELEASED);
0288 }
0289
0290 };
0291
0292
0293
0294
0295
0296
0297
0298 #define DOMNODE_FUNCTIONS \
0299 virtual DOMNode* appendChild(DOMNode *newChild) ;\
0300 virtual DOMNode* cloneNode(bool deep) const ;\
0301 virtual DOMNamedNodeMap* getAttributes() const ;\
0302 virtual DOMNodeList* getChildNodes() const ;\
0303 virtual DOMNode* getFirstChild() const ;\
0304 virtual DOMNode* getLastChild() const ;\
0305 virtual const XMLCh* getLocalName() const ;\
0306 virtual const XMLCh* getNamespaceURI() const ;\
0307 virtual DOMNode* getNextSibling() const ;\
0308 virtual const XMLCh* getNodeName() const ;\
0309 virtual NodeType getNodeType() const ;\
0310 virtual const XMLCh* getNodeValue() const ;\
0311 virtual DOMDocument* getOwnerDocument() const ;\
0312 virtual const XMLCh* getPrefix() const ;\
0313 virtual DOMNode* getParentNode() const ;\
0314 virtual DOMNode* getPreviousSibling() const ;\
0315 virtual bool hasChildNodes() const ;\
0316 virtual DOMNode* insertBefore(DOMNode *newChild, DOMNode *refChild) ;\
0317 virtual void normalize() ;\
0318 virtual DOMNode* removeChild(DOMNode *oldChild) ;\
0319 virtual DOMNode* replaceChild(DOMNode *newChild, DOMNode *oldChild) ;\
0320 virtual void setNodeValue(const XMLCh *nodeValue) ;\
0321 virtual bool isSupported(const XMLCh *feature, const XMLCh *version) const ;\
0322 virtual bool hasAttributes() const ;\
0323 virtual void setPrefix(const XMLCh * prefix) ;\
0324 virtual void* setUserData(const XMLCh* key, void* data, DOMUserDataHandler* handler) ;\
0325 virtual void* getUserData(const XMLCh* key) const ;\
0326 virtual bool isSameNode(const DOMNode* other) const;\
0327 virtual bool isEqualNode(const DOMNode* arg) const;\
0328 virtual const XMLCh* getBaseURI() const ;\
0329 virtual short compareDocumentPosition(const DOMNode* other) const ;\
0330 virtual const XMLCh* getTextContent() const ;\
0331 const XMLCh* getTextContent(XMLCh* pzBuffer, unsigned int& rnBufferLength) const;\
0332 virtual void setTextContent(const XMLCh* textContent) ;\
0333 virtual const XMLCh* lookupPrefix(const XMLCh* namespaceURI) const ;\
0334 virtual bool isDefaultNamespace(const XMLCh* namespaceURI) const;\
0335 virtual const XMLCh* lookupNamespaceURI(const XMLCh* prefix) const ;\
0336 virtual void* getFeature(const XMLCh* feature, const XMLCh* version) const ;\
0337 virtual void release()
0338
0339
0340
0341
0342
0343
0344
0345
0346
0347
0348
0349
0350
0351
0352
0353
0354
0355
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381
0382
0383
0384
0385
0386
0387
0388
0389 XERCES_CPP_NAMESPACE_END
0390
0391 #endif