Warnings on vc14 were eliminated
[occt.git] / src / BinMDocStd / BinMDocStd_XLinkDriver.cxx
CommitLineData
b311480e 1// Created on: 2004-05-13
2// Created by: Sergey ZARITCHNY
973c2be1 3// Copyright (c) 2004-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 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
973c2be1 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
42cf5bc1 16
7fd59977 17#include <BinMDF_ADriver.hxx>
42cf5bc1 18#include <BinMDocStd_XLinkDriver.hxx>
7fd59977 19#include <BinObjMgt_Persistent.hxx>
20#include <BinObjMgt_RRelocationTable.hxx>
21#include <BinObjMgt_SRelocationTable.hxx>
42cf5bc1 22#include <CDM_MessageDriver.hxx>
23#include <Standard_Type.hxx>
24#include <TDF_Attribute.hxx>
25#include <TDocStd_XLink.hxx>
26
92efcf78 27IMPLEMENT_STANDARD_RTTIEXT(BinMDocStd_XLinkDriver,BinMDF_ADriver)
28
7fd59977 29//=======================================================================
30//function : BinMDocStd_XLinkDriver
31//purpose :
32//=======================================================================
7fd59977 33BinMDocStd_XLinkDriver::BinMDocStd_XLinkDriver
34 (const Handle(CDM_MessageDriver)& theMsgDriver)
35 : BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TDocStd_XLink)->Name())
36{
37}
38
39//=======================================================================
40//function : NewEmpty
41//purpose :
42//=======================================================================
43
44Handle(TDF_Attribute) BinMDocStd_XLinkDriver::NewEmpty() const
45{
46 return new TDocStd_XLink();
47}
48
49//=======================================================================
50//function : Paste
51//purpose : persistent -> transient (retrieve)
52//=======================================================================
53
54Standard_Boolean BinMDocStd_XLinkDriver::Paste
55 (const BinObjMgt_Persistent& theSource,
56 const Handle(TDF_Attribute)& theTarget,
57 BinObjMgt_RRelocationTable& ) const
58{
59 TCollection_AsciiString aStr;
60 Standard_Boolean ok = theSource >> aStr;
61 if(ok) {
62 Handle(TDocStd_XLink) anAtt = Handle(TDocStd_XLink)::DownCast(theTarget);
63 anAtt->DocumentEntry(aStr);
64 aStr.Clear();
65 ok = theSource >> aStr;
66 if(ok)
67 anAtt->LabelEntry(aStr);
68 }
69 return ok;
70}
71
72//=======================================================================
73//function : Paste
74//purpose : transient -> persistent (store)
75//=======================================================================
76
77void BinMDocStd_XLinkDriver::Paste (const Handle(TDF_Attribute)& theSource,
78 BinObjMgt_Persistent& theTarget,
79 BinObjMgt_SRelocationTable& ) const
80{
81 Handle(TDocStd_XLink) anAtt = Handle(TDocStd_XLink)::DownCast(theSource);
82 theTarget << anAtt->DocumentEntry() << anAtt->LabelEntry();
83}
84
85