summaryrefslogtreecommitdiff
path: root/src/BinMDataStd/BinMDataStd_CommentDriver.cxx
blob: 953cfeda53481cfbafdeef4f424ad92e097e564d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// File:        BinMDataStd_CommentDriver.cxx
// Created:     Fri Aug 24 20:46:58 2001
// Author:      Alexnder GRIGORIEV
// Copyright:   Open Cascade 2001
// History:

#include <BinMDataStd_CommentDriver.ixx>
#include <TDataStd_Comment.hxx>

//=======================================================================
//function : BinMDataStd_CommentDriver
//purpose  : Constructor
//=======================================================================

BinMDataStd_CommentDriver::BinMDataStd_CommentDriver
                        (const Handle(CDM_MessageDriver)& theMsgDriver)
      : BinMDF_ADriver (theMsgDriver, NULL)
{}

//=======================================================================
//function : NewEmpty
//purpose  : 
//=======================================================================
Handle(TDF_Attribute) BinMDataStd_CommentDriver::NewEmpty() const
{
  return (new TDataStd_Comment());
}

//=======================================================================
//function : Paste
//purpose  : 
//=======================================================================
Standard_Boolean BinMDataStd_CommentDriver::Paste
                                (const BinObjMgt_Persistent&  theSource,
                                 const Handle(TDF_Attribute)& theTarget,
                                 BinObjMgt_RRelocationTable&  ) const
{
  TCollection_ExtendedString aString;
  Standard_Boolean ok = theSource >> aString;
  if (ok)
    Handle(TDataStd_Comment)::DownCast(theTarget) -> Set (aString);
  return ok;
}

//=======================================================================
//function : Paste
//purpose  : 
//=======================================================================
void BinMDataStd_CommentDriver::Paste (const Handle(TDF_Attribute)& theSource,
                                       BinObjMgt_Persistent&        theTarget,
                                       BinObjMgt_SRelocationTable&  ) const
{
  TCollection_ExtendedString aName =
    Handle(TDataStd_Comment)::DownCast(theSource) -> Get();
  theTarget << aName;
}