1 // Created on: 2017-02-10
2 // Created by: Eugeny NIKONOV
3 // Copyright (c) 2005-2017 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 <BinObjMgt_Persistent.hxx>
17 #include <CDM_MessageDriver.hxx>
18 #include <Standard_Type.hxx>
19 #include <TDF_Attribute.hxx>
20 #include <BinMXCAFDoc_NoteDriver.hxx>
21 #include <XCAFDoc_Note.hxx>
23 IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteDriver, BinMDF_ADriver)
25 //=======================================================================
28 //=======================================================================
29 BinMXCAFDoc_NoteDriver::BinMXCAFDoc_NoteDriver(const Handle(CDM_MessageDriver)& theMsgDriver,
30 Standard_CString theName)
31 : BinMDF_ADriver(theMsgDriver, theName)
36 //=======================================================================
39 //=======================================================================
40 Standard_Boolean BinMXCAFDoc_NoteDriver::Paste(const BinObjMgt_Persistent& theSource,
41 const Handle(TDF_Attribute)& theTarget,
42 BinObjMgt_RRelocationTable& /*theRelocTable*/) const
44 Handle(XCAFDoc_Note) aNote = Handle(XCAFDoc_Note)::DownCast(theTarget);
46 return Standard_False;
48 TCollection_ExtendedString aUserName, aTimeStamp;
49 if (!(theSource >> aUserName >> aTimeStamp))
50 return Standard_False;
52 aNote->Set(aUserName, aTimeStamp);
57 //=======================================================================
60 //=======================================================================
61 void BinMXCAFDoc_NoteDriver::Paste(const Handle(TDF_Attribute)& theSource,
62 BinObjMgt_Persistent& theTarget,
63 BinObjMgt_SRelocationTable& /*theRelocTable*/) const
65 Handle(XCAFDoc_Note) aNote = Handle(XCAFDoc_Note)::DownCast(theSource);
67 theTarget << aNote->UserName() << aNote->TimeStamp();