0025621: CAST analysis - Avoid constructors not supplying an initial value for all...
[occt.git] / src / LDOM / LDOM_BasicAttribute.hxx
1 // Created on: 2001-06-26
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef LDOM_BasicAttribute_HeaderFile
17 #define LDOM_BasicAttribute_HeaderFile
18
19 #include <LDOM_BasicNode.hxx>
20 #include <LDOMBasicString.hxx>
21
22 class LDOM_XmlReader;
23 class LDOM_Element;
24 class LDOM_Attr;
25 class LDOM_Node;
26
27 //  Class LDOM_BasicAttribute
28 //
29
30 class LDOM_BasicAttribute : public LDOM_BasicNode
31 {
32  public:
33   // ---------- PUBLIC METHODS ----------
34
35   LDOM_BasicAttribute () : LDOM_BasicNode (LDOM_Node::UNKNOWN) {}
36   //    Empty constructor
37
38   LDOM_BasicAttribute&  operator =      (const LDOM_NullPtr * aNull);
39   //    Nullify
40
41   const char *           GetName        () const { return myName; }
42
43   const LDOMBasicString& GetValue       () const { return myValue; }
44
45   void                   SetValue       (const LDOMBasicString&         aValue,
46                                          const Handle(LDOM_MemManager)& aDoc)
47                                 { myValue = LDOMString (aValue, aDoc); }
48
49  private:
50   friend class LDOM_Node;
51   friend class LDOM_Attr;
52   friend class LDOM_Element;
53   friend class LDOM_BasicElement;
54   friend class LDOM_XmlReader;
55   
56   // ---------- PRIVATE METHODS ----------
57
58   LDOM_BasicAttribute (const LDOMBasicString& aName)
59     : LDOM_BasicNode (LDOM_Node::ATTRIBUTE_NODE), myName (aName.GetString()) {}
60   //    Constructor
61
62   static LDOM_BasicAttribute& Create (const LDOMBasicString&           theName,
63                                       const Handle(LDOM_MemManager)&   theDoc,
64                                       Standard_Integer&           theHashIndex);
65
66   LDOM_BasicAttribute (const LDOM_Attr& anAttr);
67
68  private:
69   // ---------- PRIVATE FIELDS ----------
70
71 //  LDOMBasicString       myName;
72   const char            * myName;
73   LDOMBasicString       myValue;
74 };
75
76 #endif