0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / LDOM / LDOM_BasicText.hxx
1 // Created on: 2001-07-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_BasicText_HeaderFile
17 #define LDOM_BasicText_HeaderFile
18
19 #include <LDOM_BasicNode.hxx>
20 #include <LDOMBasicString.hxx>
21
22 class LDOM_Node;
23 class LDOM_CharacterData;
24 class LDOMParser;
25 class LDOM_BasicElement;
26
27 //  Class LDOM_BasicText
28 //
29
30 class LDOM_BasicText : public LDOM_BasicNode
31 {
32  public:
33
34   // ---------- PUBLIC METHODS ----------
35
36   LDOM_BasicText () : LDOM_BasicNode (LDOM_Node::UNKNOWN) {}
37   //    Empty constructor
38
39   LDOM_BasicText&       operator =      (const LDOM_NullPtr * aNull);
40   //    Nullify
41
42   const LDOMBasicString& GetData        () const
43                                 { return myValue; }
44
45   void                  SetData         (const LDOMBasicString&         aValue,
46                                          const Handle(LDOM_MemManager)& aDoc)
47                                 { myValue = LDOMString (aValue, aDoc); }
48
49  private:
50   // ---------- PRIVATE METHODS ----------
51   friend class LDOM_Node;
52   friend class LDOMParser;
53   friend class LDOM_Document;
54   friend class LDOM_BasicElement;
55
56   LDOM_BasicText                        (const LDOM_Node::NodeType aType,
57                                          const LDOMBasicString&    aData)
58     : LDOM_BasicNode (aType), myValue (aData) {}
59   // Constructor
60
61   LDOM_BasicText                        (const LDOM_CharacterData& aText);
62
63   static LDOM_BasicText& Create         (const LDOM_Node::NodeType      aType,
64                                          const LDOMBasicString&         aData,
65                                          const Handle(LDOM_MemManager)& aDoc);
66   // Creation
67
68  private:
69   // ---------- PRIVATE FIELDS ----------
70
71   LDOMBasicString       myValue;
72 };
73
74 #endif