Integration of OCCT 6.5.0 from SVN
[occt.git] / src / BinMDataStd / BinMDataStd_CommentDriver.cxx
CommitLineData
7fd59977 1// File: BinMDataStd_CommentDriver.cxx
2// Created: Fri Aug 24 20:46:58 2001
3// Author: Alexnder GRIGORIEV
4// Copyright: Open Cascade 2001
5// History:
6
7#include <BinMDataStd_CommentDriver.ixx>
8#include <TDataStd_Comment.hxx>
9
10//=======================================================================
11//function : BinMDataStd_CommentDriver
12//purpose : Constructor
13//=======================================================================
14
15BinMDataStd_CommentDriver::BinMDataStd_CommentDriver
16 (const Handle(CDM_MessageDriver)& theMsgDriver)
17 : BinMDF_ADriver (theMsgDriver, NULL)
18{}
19
20//=======================================================================
21//function : NewEmpty
22//purpose :
23//=======================================================================
24Handle(TDF_Attribute) BinMDataStd_CommentDriver::NewEmpty() const
25{
26 return (new TDataStd_Comment());
27}
28
29//=======================================================================
30//function : Paste
31//purpose :
32//=======================================================================
33Standard_Boolean BinMDataStd_CommentDriver::Paste
34 (const BinObjMgt_Persistent& theSource,
35 const Handle(TDF_Attribute)& theTarget,
36 BinObjMgt_RRelocationTable& ) const
37{
38 TCollection_ExtendedString aString;
39 Standard_Boolean ok = theSource >> aString;
40 if (ok)
41 Handle(TDataStd_Comment)::DownCast(theTarget) -> Set (aString);
42 return ok;
43}
44
45//=======================================================================
46//function : Paste
47//purpose :
48//=======================================================================
49void BinMDataStd_CommentDriver::Paste (const Handle(TDF_Attribute)& theSource,
50 BinObjMgt_Persistent& theTarget,
51 BinObjMgt_SRelocationTable& ) const
52{
53 TCollection_ExtendedString aName =
54 Handle(TDataStd_Comment)::DownCast(theSource) -> Get();
55 theTarget << aName;
56}