7fd59977 |
1 | // File : BinMDataStd_NameDriver.cxx |
2 | // Created : Tue Nov 19 12:30:18 2002 |
3 | // Author : Edward AGAPOV (eap) |
4 | // Copyright : Open CASCADE |
5 | |
6 | |
7 | #include <BinMDataStd_NameDriver.ixx> |
8 | #include <TDataStd_Name.hxx> |
9 | |
10 | //======================================================================= |
11 | //function : BinMDataStd_NameDriver |
12 | //purpose : |
13 | //======================================================================= |
14 | |
15 | BinMDataStd_NameDriver::BinMDataStd_NameDriver |
16 | (const Handle(CDM_MessageDriver)& theMessageDriver) |
17 | : BinMDF_ADriver (theMessageDriver, STANDARD_TYPE(TDataStd_Name)->Name()) |
18 | { |
19 | } |
20 | |
21 | //======================================================================= |
22 | //function : NewEmpty |
23 | //purpose : |
24 | //======================================================================= |
25 | |
26 | Handle(TDF_Attribute) BinMDataStd_NameDriver::NewEmpty() const |
27 | { |
28 | return new TDataStd_Name; |
29 | } |
30 | |
31 | //======================================================================= |
32 | //function : Paste |
33 | //purpose : persistent -> transient (retrieve) |
34 | //======================================================================= |
35 | |
36 | Standard_Boolean BinMDataStd_NameDriver::Paste |
37 | (const BinObjMgt_Persistent& Source, |
38 | const Handle(TDF_Attribute)& Target, |
39 | BinObjMgt_RRelocationTable& /*RelocTable*/) const |
40 | { |
41 | Handle(TDataStd_Name) aName = Handle(TDataStd_Name)::DownCast(Target); |
42 | TCollection_ExtendedString aStr; |
43 | Standard_Boolean ok = Source >> aStr; |
44 | if (ok) |
45 | aName->Set( aStr ); |
46 | return ok; |
47 | } |
48 | |
49 | //======================================================================= |
50 | //function : Paste |
51 | //purpose : transient -> persistent (store) |
52 | //======================================================================= |
53 | |
54 | void BinMDataStd_NameDriver::Paste |
55 | (const Handle(TDF_Attribute)& Source, |
56 | BinObjMgt_Persistent& Target, |
57 | BinObjMgt_SRelocationTable& /*RelocTable*/) const |
58 | { |
59 | Handle(TDataStd_Name) aName = Handle(TDataStd_Name)::DownCast(Source); |
60 | Target << aName->Get(); |
61 | } |