1 // Created by: DAUTRY Philippe
2 // Copyright (c) 1997-1999 Matra Datavision
3 // Copyright (c) 1999-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 // -----------------------------
19 //Version Date Purpose
20 // 0.0 Sep 17 1997 Creation
24 #include <MDocStd_XLinkRetrievalDriver.ixx>
25 #include <TDocStd_XLink.hxx>
26 #include <PDocStd_XLink.hxx>
27 #include <TCollection_AsciiString.hxx>
28 #include <PCollection_HAsciiString.hxx>
29 #include <CDM_MessageDriver.hxx>
31 #define DeclareAndSpeedCast(V,T,Vdown) Handle(T) Vdown = *((Handle(T)*)& V)
32 #define DeclareConstAndSpeedCast(V,T,Vdown) const Handle(T)& Vdown = (Handle(T)&) V
33 #define SpeedCast(V,T,Vdown) Vdown = *((Handle(T)*)& V)
35 //=======================================================================
36 //function : MDocStd_XLinkRetrievalDriver
38 //=======================================================================
40 MDocStd_XLinkRetrievalDriver::MDocStd_XLinkRetrievalDriver(const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
44 //=======================================================================
45 //function : VersionNumber
47 //=======================================================================
49 Standard_Integer MDocStd_XLinkRetrievalDriver::VersionNumber() const
53 //=======================================================================
54 //function : SourceType
56 //=======================================================================
58 Handle(Standard_Type) MDocStd_XLinkRetrievalDriver::SourceType() const
59 { return STANDARD_TYPE(PDocStd_XLink); }
62 //=======================================================================
65 //=======================================================================
67 Handle(TDF_Attribute) MDocStd_XLinkRetrievalDriver::NewEmpty() const
68 { return new TDocStd_XLink(); }
71 //=======================================================================
74 //=======================================================================
76 void MDocStd_XLinkRetrievalDriver::Paste
77 (const Handle(PDF_Attribute)& aSource,
78 const Handle(TDF_Attribute)& aTarget,
79 // const Handle(MDF_RRelocationTable)& aRelocTable) const
80 const Handle(MDF_RRelocationTable)& ) const
82 DeclareConstAndSpeedCast(aSource,PDocStd_XLink,pxref);
83 DeclareConstAndSpeedCast(aTarget,TDocStd_XLink,txref);
84 txref->DocumentEntry(pxref->DocumentEntry()->Convert());
85 txref->LabelEntry(pxref->LabelEntry()->Convert());