Test for 0022778: Bug in BRepMesh
[occt.git] / src / MDataStd / MDataStd_AsciiStringRetrievalDriver.cxx
1 // Created on: 2007-08-23
2 // Created by: Sergey ZARITCHNY
3 // Copyright (c) 2007-2012 OPEN CASCADE SAS
4 //
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
9 //
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 //
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
19
20
21 #include <MDataStd_AsciiStringRetrievalDriver.ixx>
22 #include <PDataStd_AsciiString.hxx>
23 #include <TDataStd_AsciiString.hxx>
24 #include <TCollection_AsciiString.hxx>
25 #include <PCollection_HAsciiString.hxx>
26 #include <CDM_MessageDriver.hxx>
27
28 //=======================================================================
29 //function : MDataStd_AsciiStringRetrievalDriver
30 //purpose  : Constructor
31 //=======================================================================
32 MDataStd_AsciiStringRetrievalDriver::MDataStd_AsciiStringRetrievalDriver
33   (const Handle(CDM_MessageDriver)& theMsgDriver):MDF_ARDriver(theMsgDriver)
34 {
35 }
36 //=======================================================================
37 //function : VersionNumber
38 //purpose  : 
39 //=======================================================================
40 Standard_Integer MDataStd_AsciiStringRetrievalDriver::VersionNumber() const
41 { return 0; }
42
43 //=======================================================================
44 //function : SourceType
45 //purpose  : 
46 //=======================================================================
47 Handle(Standard_Type) MDataStd_AsciiStringRetrievalDriver::SourceType() const
48 { return STANDARD_TYPE(PDataStd_AsciiString); }
49
50 //=======================================================================
51 //function : NewEmpty
52 //purpose  : 
53 //=======================================================================
54 Handle(TDF_Attribute) MDataStd_AsciiStringRetrievalDriver::NewEmpty() const
55 { return new TDataStd_AsciiString (); }
56
57 //=======================================================================
58 //function : Paste
59 //purpose  : 
60 //=======================================================================
61 void MDataStd_AsciiStringRetrievalDriver::Paste(const Handle(PDF_Attribute)& Source,
62 const Handle(TDF_Attribute)& Target,const Handle(MDF_RRelocationTable)& ) const
63 {
64   Handle(PDataStd_AsciiString) S = Handle(PDataStd_AsciiString)::DownCast (Source);
65   Handle(TDataStd_AsciiString) T = Handle(TDataStd_AsciiString)::DownCast (Target);
66   if(!S.IsNull() && !T.IsNull()) {
67     if(!S->Get().IsNull()) {
68       TCollection_AsciiString aString((S->Get())->Convert ());
69       T->Set (aString);
70     }
71   }
72 }
73