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 #ifndef LDOM_BasicElement_HeaderFile
0019 #define LDOM_BasicElement_HeaderFile
0020
0021 #include <LDOM_BasicNode.hxx>
0022 #include <LDOMBasicString.hxx>
0023 #include <LDOM_Node.hxx>
0024
0025 class LDOM_NodeList;
0026 class LDOM_BasicAttribute;
0027
0028
0029
0030
0031 class LDOM_BasicElement : public LDOM_BasicNode
0032 {
0033 public:
0034
0035
0036
0037 LDOM_BasicElement ()
0038 : LDOM_BasicNode (LDOM_Node::UNKNOWN),
0039 myTagName (NULL),
0040 myAttributeMask (0),
0041 myFirstChild (NULL) {}
0042
0043
0044 static LDOM_BasicElement& Create (const char * aName,
0045 const Standard_Integer aLength,
0046 const Handle(LDOM_MemManager)& aDoc);
0047
0048
0049
0050
0051 Standard_EXPORT LDOM_BasicElement&
0052 operator = (const LDOM_NullPtr * aNull);
0053
0054
0055 Standard_EXPORT ~LDOM_BasicElement ();
0056
0057
0058 const char * GetTagName () const { return myTagName; }
0059
0060 const LDOM_BasicNode *
0061 GetFirstChild () const { return myFirstChild; }
0062
0063 Standard_EXPORT const LDOM_BasicNode *
0064 GetLastChild () const;
0065
0066 Standard_EXPORT const LDOM_BasicAttribute&
0067 GetAttribute (const LDOMBasicString& aName,
0068 const LDOM_BasicNode * aLastCh) const;
0069
0070
0071 protected:
0072
0073
0074
0075
0076
0077 Standard_EXPORT const LDOM_BasicNode *
0078 AddAttribute (const LDOMBasicString& anAttrName,
0079 const LDOMBasicString& anAttrValue,
0080 const Handle(LDOM_MemManager)& aDoc,
0081 const LDOM_BasicNode * aLastCh);
0082
0083
0084 Standard_EXPORT const LDOM_BasicNode *
0085 RemoveAttribute (const LDOMBasicString& aName,
0086 const LDOM_BasicNode * aLastCh) const;
0087
0088 Standard_EXPORT void
0089 RemoveChild (const LDOM_BasicNode * aChild) const;
0090
0091
0092 Standard_EXPORT void
0093 AppendChild (const LDOM_BasicNode * aChild,
0094 const LDOM_BasicNode *& aLastCh) const;
0095
0096
0097 private:
0098 friend class LDOMParser;
0099 friend class LDOM_XmlReader;
0100 friend class LDOM_Document;
0101 friend class LDOM_Element;
0102 friend class LDOM_Node;
0103
0104
0105 const LDOM_BasicAttribute *
0106 GetFirstAttribute (const LDOM_BasicNode *& aLastCh,
0107 const LDOM_BasicNode **& thePrN) const;
0108
0109 void RemoveNodes ();
0110
0111 void ReplaceElement (const LDOM_BasicElement& anOther,
0112 const Handle(LDOM_MemManager)& aDoc);
0113
0114
0115 void AddElementsByTagName (LDOM_NodeList& aList,
0116 const LDOMBasicString& aTagName) const;
0117
0118
0119 void AddAttributes (LDOM_NodeList& aList,
0120 const LDOM_BasicNode * aLastCh) const;
0121
0122
0123 private:
0124
0125
0126
0127 const char * myTagName;
0128 unsigned long myAttributeMask;
0129 LDOM_BasicNode * myFirstChild;
0130 };
0131
0132 #endif