0024023: Revamp the OCCT Handle - gcc and clang
[occt.git] / src / LDOM / LDOM_Element.hxx
CommitLineData
b311480e 1// Created on: 2001-06-26
2// Created by: Alexander GRIGORIEV
973c2be1 3// Copyright (c) 2001-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
16#ifndef LDOM_Element_HeaderFile
17#define LDOM_Element_HeaderFile
18
19#include <LDOM_Attr.hxx>
20#include <LDOM_NodeList.hxx>
21
22class LDOMParser;
23class LDOM_BasicElement;
24
25// Class LDOM_Element
26//
27
28class LDOM_Element : public LDOM_Node
29{
30 public:
31 // ---------- PUBLIC METHODS ----------
32
33 LDOM_Element () {}
34 // Empty constructor
35
36 LDOM_Element (const LDOM_Element& anOther) : LDOM_Node (anOther) {}
37 // Copy constructor
38
39 LDOM_Element& operator = (const LDOM_Element& anOther)
40 { return (LDOM_Element&) LDOM_Node::operator = (anOther); }
41 // Assignment
42
43 Standard_EXPORT LDOM_Element&
44 operator = (const LDOM_NullPtr * aNull)
45 { return (LDOM_Element&) LDOM_Node::operator = (aNull); }
46 // Nullify
47
48 LDOMString getTagName () const { return getNodeName(); }
49
50 Standard_EXPORT LDOMString
51 getAttribute (const LDOMString& aName) const;
52
53 Standard_EXPORT LDOM_Attr
54 getAttributeNode (const LDOMString& aName) const;
55
56 Standard_EXPORT LDOM_NodeList
57 getElementsByTagName (const LDOMString& aName) const;
58
59 Standard_EXPORT void setAttribute (const LDOMString& aName,
60 const LDOMString& aValue);
61
62 Standard_EXPORT void setAttributeNode(const LDOM_Attr& aNewAttr);
63
64 Standard_EXPORT void removeAttribute (const LDOMString& aName);
65
66// AGV auxiliary API
67 Standard_EXPORT LDOM_Element
68 GetChildByTagName (const LDOMString& aTagName) const;
69
70 Standard_EXPORT LDOM_Element
71 GetSiblingByTagName () const;
72
73 Standard_EXPORT void
74 ReplaceElement (const LDOM_Element& anOther);
75 // The old element is destroyed by the new one
76
77 Standard_EXPORT LDOM_NodeList
78 GetAttributesList () const;
79
80 protected:
81 friend class LDOM_Document;
82 friend class LDOMParser;
83 // ---------- PROTECTED METHODS ----------
84
85 LDOM_Element (const LDOM_BasicElement& anElem,
86 const Handle(LDOM_MemManager)& aDoc);
87
88 private:
89 // ---------- PRIVATE FIELDS ----------
90
91};
92
93
94#endif