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.
16 #include <TDataStd_AsciiString.ixx>
17 #include <Standard_GUID.hxx>
18 #include <TDF_Label.hxx>
20 //=======================================================================
21 //function : TDataStd_AsciiString
23 //=======================================================================
25 TDataStd_AsciiString::TDataStd_AsciiString()
30 //=======================================================================
33 //=======================================================================
35 const Standard_GUID& TDataStd_AsciiString::GetID()
37 static Standard_GUID theGUID ("3bbefc60-e618-11d4-ba38-0060b0ee18ea");
41 //=======================================================================
44 //=======================================================================
46 const Standard_GUID& TDataStd_AsciiString::ID() const
51 //=======================================================================
54 //=======================================================================
56 Handle(TDataStd_AsciiString) TDataStd_AsciiString::Set (
57 const TDF_Label& theLabel,
58 const TCollection_AsciiString& theAsciiString)
60 Handle(TDataStd_AsciiString) A;
61 if (!theLabel.FindAttribute(TDataStd_AsciiString::GetID(), A))
63 A = new TDataStd_AsciiString;
64 theLabel.AddAttribute(A);
66 A->Set(theAsciiString);
70 //=======================================================================
73 //=======================================================================
75 void TDataStd_AsciiString::Set (const TCollection_AsciiString& theAsciiString)
78 myString = theAsciiString;
81 //=======================================================================
84 //=======================================================================
86 const TCollection_AsciiString& TDataStd_AsciiString::Get () const
91 //=======================================================================
94 //=======================================================================
96 Handle(TDF_Attribute) TDataStd_AsciiString::NewEmpty () const
98 return new TDataStd_AsciiString();
101 //=======================================================================
104 //=======================================================================
106 void TDataStd_AsciiString::Restore (const Handle(TDF_Attribute)& theWith)
108 Handle(TDataStd_AsciiString) R = Handle(TDataStd_AsciiString)::DownCast(theWith);
112 //=======================================================================
115 //=======================================================================
117 void TDataStd_AsciiString::Paste (const Handle(TDF_Attribute)& theInto,
118 const Handle(TDF_RelocationTable)& /* RT */) const
120 Handle(TDataStd_AsciiString) R = Handle(TDataStd_AsciiString)::DownCast (theInto);
124 //=======================================================================
127 //=======================================================================
128 Standard_Boolean TDataStd_AsciiString::IsEmpty () const
130 return myString.IsEmpty();
132 //=======================================================================
135 //=======================================================================
137 Standard_OStream& TDataStd_AsciiString::Dump(Standard_OStream& theOS) const
139 Standard_OStream& anOS = TDF_Attribute::Dump( theOS );