0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / StepData / StepData_ReadWriteModule.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14
15 #include <Interface_Check.hxx>
16 #include <Interface_FileReaderData.hxx>
17 #include <Interface_Macros.hxx>
18 #include <Standard_DomainError.hxx>
19 #include <Standard_Transient.hxx>
20 #include <Standard_Type.hxx>
21 #include <StepData_ReadWriteModule.hxx>
22 #include <StepData_StepReaderData.hxx>
23 #include <StepData_StepWriter.hxx>
24 #include <TCollection_AsciiString.hxx>
25
26 Standard_Integer  StepData_ReadWriteModule::CaseNum
27   (const Handle(Interface_FileReaderData)& data,
28    const Standard_Integer num) const
29 {
30   DeclareAndCast(StepData_StepReaderData,stepdat,data);
31   if (stepdat.IsNull()) return 0;
32   if (stepdat->IsComplex(num)) {
33     TColStd_SequenceOfAsciiString types;
34     stepdat->ComplexType (num,types);
35     if (types.IsEmpty()) return 0;
36     if (types.Length() == 1) return CaseStep (types.Value(1));
37     else return CaseStep (types);
38   }
39   return CaseStep (stepdat->RecordType(num));
40 }
41
42 Standard_Integer  StepData_ReadWriteModule::CaseStep (const TColStd_SequenceOfAsciiString&) const
43 {  
44   return 0;
45 }        // par defaut
46
47 Standard_Boolean  StepData_ReadWriteModule::IsComplex (const Standard_Integer) const
48 {
49     return Standard_False;  
50 }  // par defaut
51
52 TCollection_AsciiString  StepData_ReadWriteModule::ShortType (const Standard_Integer ) const
53 {
54   return TCollection_AsciiString("");  
55 }  // par defaut vide
56
57 Standard_Boolean  StepData_ReadWriteModule::ComplexType (const Standard_Integer ,
58                                                          TColStd_SequenceOfAsciiString& ) const
59 {
60   return Standard_False; 
61 }
62
63
64 //=======================================================================
65 //function : Read
66 //purpose  : 
67 //=======================================================================
68
69 void StepData_ReadWriteModule::Read(const Standard_Integer CN,
70                                     const Handle(Interface_FileReaderData)& data,
71                                     const Standard_Integer num,
72                                     Handle(Interface_Check)& ach,
73                                     const Handle(Standard_Transient)& ent) const 
74 {
75   DeclareAndCast(StepData_StepReaderData,stepdat,data);
76   if (stepdat.IsNull()) return;
77   ReadStep (CN,stepdat,num,ach,ent);
78 }