File indexing completed on 2025-01-18 10:04:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef LDOM_Node_HeaderFile
0020 #define LDOM_Node_HeaderFile
0021
0022 #include <LDOMString.hxx>
0023 #include <LDOM_MemManager.hxx>
0024
0025 class LDOM_BasicNode;
0026
0027
0028
0029
0030
0031
0032
0033
0034 class LDOM_Node
0035 {
0036 public:
0037 enum NodeType {
0038 UNKNOWN = 0,
0039 ELEMENT_NODE = 1,
0040 ATTRIBUTE_NODE = 2,
0041 TEXT_NODE = 3,
0042 CDATA_SECTION_NODE = 4,
0043 COMMENT_NODE = 8
0044 };
0045
0046
0047
0048 LDOM_Node () : myOrigin (NULL),
0049 myLastChild (NULL) {}
0050
0051
0052 LDOM_Node (const LDOM_Node& anOther)
0053 : myDocument (anOther.myDocument),
0054 myOrigin (anOther.myOrigin),
0055 myLastChild (anOther.myLastChild) {}
0056
0057
0058 Standard_EXPORT const LDOM_MemManager& getOwnerDocument () const;
0059
0060 Standard_EXPORT LDOM_Node&
0061 operator = (const LDOM_Node& anOther);
0062
0063 Standard_EXPORT LDOM_Node&
0064 operator = (const LDOM_NullPtr * aNull);
0065
0066 Standard_Boolean operator == (const LDOM_NullPtr *) const
0067 { return isNull(); }
0068
0069 Standard_Boolean operator != (const LDOM_NullPtr *) const
0070 { return ! isNull(); }
0071
0072 Standard_EXPORT Standard_Boolean
0073 operator == (const LDOM_Node& anOther) const;
0074
0075 Standard_EXPORT Standard_Boolean
0076 operator != (const LDOM_Node& anOther) const;
0077
0078 Standard_EXPORT Standard_Boolean
0079 isNull () const;
0080
0081 Standard_EXPORT NodeType
0082 getNodeType () const;
0083
0084 Standard_EXPORT LDOMString
0085 getNodeName () const;
0086
0087 Standard_EXPORT LDOMString
0088 getNodeValue () const;
0089
0090 Standard_EXPORT LDOM_Node
0091 getFirstChild () const;
0092
0093 Standard_EXPORT LDOM_Node
0094 getLastChild () const;
0095
0096 Standard_EXPORT LDOM_Node
0097 getNextSibling () const;
0098
0099 Standard_EXPORT void removeChild (const LDOM_Node& aChild);
0100
0101 Standard_EXPORT void appendChild (const LDOM_Node& aChild);
0102
0103 Standard_EXPORT Standard_Boolean
0104 hasChildNodes () const;
0105
0106 Standard_EXPORT void SetValueClear () const;
0107
0108
0109
0110
0111 protected:
0112 friend class LDOM_BasicAttribute;
0113 friend class LDOM_BasicElement;
0114 friend class LDOM_BasicText;
0115 friend class LDOM_NodeList;
0116
0117
0118 const LDOM_BasicNode& Origin () const;
0119
0120 LDOM_Node (const LDOM_BasicNode& anOrig, const Handle(LDOM_MemManager)& aDoc)
0121 : myDocument (aDoc),
0122 myOrigin ((LDOM_BasicNode *) &anOrig),
0123 myLastChild (NULL) {}
0124
0125
0126 protected:
0127
0128
0129
0130 Handle(LDOM_MemManager) myDocument;
0131
0132
0133 LDOM_BasicNode * myOrigin;
0134
0135
0136
0137 const LDOM_BasicNode * myLastChild;
0138
0139 friend char * db_pretty_print (const LDOM_Node *, int, char *);
0140 };
0141
0142 #endif