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_BasicAttribute_HeaderFile |
17 | #define LDOM_BasicAttribute_HeaderFile |
18 | |
19 | #include <LDOM_BasicNode.hxx> |
20 | #include <LDOMBasicString.hxx> |
21 | |
7fd59977 |
22 | class LDOM_Attr; |
7fd59977 |
23 | |
7fd59977 |
24 | // Class LDOM_BasicAttribute |
25 | // |
26 | |
27 | class LDOM_BasicAttribute : public LDOM_BasicNode |
28 | { |
29 | public: |
7fd59977 |
30 | // ---------- PUBLIC METHODS ---------- |
31 | |
d533dafb |
32 | LDOM_BasicAttribute () : LDOM_BasicNode (LDOM_Node::UNKNOWN), myName(NULL) {} |
7fd59977 |
33 | // Empty constructor |
34 | |
35 | LDOM_BasicAttribute& operator = (const LDOM_NullPtr * aNull); |
36 | // Nullify |
37 | |
38 | const char * GetName () const { return myName; } |
39 | |
40 | const LDOMBasicString& GetValue () const { return myValue; } |
41 | |
42 | void SetValue (const LDOMBasicString& aValue, |
43 | const Handle(LDOM_MemManager)& aDoc) |
44 | { myValue = LDOMString (aValue, aDoc); } |
45 | |
46 | private: |
47 | friend class LDOM_Node; |
48 | friend class LDOM_Attr; |
49 | friend class LDOM_Element; |
50 | friend class LDOM_BasicElement; |
51 | friend class LDOM_XmlReader; |
52 | |
53 | // ---------- PRIVATE METHODS ---------- |
54 | |
55 | LDOM_BasicAttribute (const LDOMBasicString& aName) |
56 | : LDOM_BasicNode (LDOM_Node::ATTRIBUTE_NODE), myName (aName.GetString()) {} |
57 | // Constructor |
58 | |
59 | static LDOM_BasicAttribute& Create (const LDOMBasicString& theName, |
60 | const Handle(LDOM_MemManager)& theDoc, |
61 | Standard_Integer& theHashIndex); |
62 | |
63 | LDOM_BasicAttribute (const LDOM_Attr& anAttr); |
64 | |
65 | private: |
66 | // ---------- PRIVATE FIELDS ---------- |
67 | |
68 | // LDOMBasicString myName; |
69 | const char * myName; |
70 | LDOMBasicString myValue; |
71 | }; |
72 | |
7fd59977 |
73 | #endif |