1 // Created on: 2007-07-31
2 // Created by: Sergey ZARITCHNY
3 // Copyright (c) 2007-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
17 #include <Standard_GUID.hxx>
18 #include <Standard_Type.hxx>
19 #include <TCollection_AsciiString.hxx>
20 #include <TDataStd_AsciiString.hxx>
21 #include <TDF_Attribute.hxx>
22 #include <TDF_Label.hxx>
23 #include <TDF_RelocationTable.hxx>
25 IMPLEMENT_STANDARD_RTTIEXT(TDataStd_AsciiString,TDF_Attribute)
27 //=======================================================================
28 //function : TDataStd_AsciiString
30 //=======================================================================
31 TDataStd_AsciiString::TDataStd_AsciiString()
36 //=======================================================================
39 //=======================================================================
41 const Standard_GUID& TDataStd_AsciiString::GetID()
43 static Standard_GUID theGUID ("3bbefc60-e618-11d4-ba38-0060b0ee18ea");
47 //=======================================================================
50 //=======================================================================
52 const Standard_GUID& TDataStd_AsciiString::ID() const
57 //=======================================================================
60 //=======================================================================
62 Handle(TDataStd_AsciiString) TDataStd_AsciiString::Set (
63 const TDF_Label& theLabel,
64 const TCollection_AsciiString& theAsciiString)
66 Handle(TDataStd_AsciiString) A;
67 if (!theLabel.FindAttribute(TDataStd_AsciiString::GetID(), A))
69 A = new TDataStd_AsciiString;
70 theLabel.AddAttribute(A);
72 A->Set(theAsciiString);
76 //=======================================================================
79 //=======================================================================
81 void TDataStd_AsciiString::Set (const TCollection_AsciiString& theAsciiString)
84 myString = theAsciiString;
87 //=======================================================================
90 //=======================================================================
92 const TCollection_AsciiString& TDataStd_AsciiString::Get () const
97 //=======================================================================
100 //=======================================================================
102 Handle(TDF_Attribute) TDataStd_AsciiString::NewEmpty () const
104 return new TDataStd_AsciiString();
107 //=======================================================================
110 //=======================================================================
112 void TDataStd_AsciiString::Restore (const Handle(TDF_Attribute)& theWith)
114 Handle(TDataStd_AsciiString) R = Handle(TDataStd_AsciiString)::DownCast(theWith);
118 //=======================================================================
121 //=======================================================================
123 void TDataStd_AsciiString::Paste (const Handle(TDF_Attribute)& theInto,
124 const Handle(TDF_RelocationTable)& /* RT */) const
126 Handle(TDataStd_AsciiString) R = Handle(TDataStd_AsciiString)::DownCast (theInto);
130 //=======================================================================
133 //=======================================================================
134 Standard_Boolean TDataStd_AsciiString::IsEmpty () const
136 return myString.IsEmpty();
138 //=======================================================================
141 //=======================================================================
143 Standard_OStream& TDataStd_AsciiString::Dump(Standard_OStream& theOS) const
145 Standard_OStream& anOS = TDF_Attribute::Dump( theOS );