1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
19 #include <RWHeaderSection_RWFileDescription.ixx>
20 #include <Interface_HArray1OfHAsciiString.hxx>
23 RWHeaderSection_RWFileDescription::RWHeaderSection_RWFileDescription () {}
25 void RWHeaderSection_RWFileDescription::ReadStep
26 (const Handle(StepData_StepReaderData)& data,
27 const Standard_Integer num,
28 Handle(Interface_Check)& ach,
29 const Handle(HeaderSection_FileDescription)& ent) const
33 // --- Number of Parameter Control ---
35 if (!data->CheckNbParams(num,2,ach,"file_description has not 2 parameter(s)")) return;
37 // --- own field : description ---
39 Handle(Interface_HArray1OfHAsciiString) aDescription;
40 Handle(TCollection_HAsciiString) aDescriptionItem;
41 Standard_Integer nsub1;
42 nsub1 = data->SubListNumber(num, 1, Standard_False);
44 Standard_Integer nb1 = data->NbParams(nsub1);
45 aDescription = new Interface_HArray1OfHAsciiString (1, nb1);
46 for (Standard_Integer i1 = 1; i1 <= nb1; i1 ++) {
47 Standard_Boolean stat1 = data->ReadString
48 (nsub1,i1,"description",ach,aDescriptionItem);
49 if (stat1) aDescription->SetValue(i1,aDescriptionItem);
53 ach->AddFail("Parameter #1 (description) is not a LIST");
56 // --- own field : implementationLevel ---
58 Handle(TCollection_HAsciiString) aImplementationLevel;
59 Standard_Boolean stat2;
60 stat2 = data->ReadString (num,2,"implementation_level",ach,aImplementationLevel);
62 //--- Initialisation of the read entity ---
65 if (!ach->HasFailed()) ent->Init(aDescription, aImplementationLevel);
69 void RWHeaderSection_RWFileDescription::WriteStep
70 (StepData_StepWriter& SW,
71 const Handle(HeaderSection_FileDescription)& ent) const
74 // --- own field : description ---
77 for (Standard_Integer i1 = 1; i1 <= ent->NbDescription(); i1 ++) {
78 SW.Send(ent->DescriptionValue(i1));
82 // --- own field : implementationLevel ---
84 SW.Send(ent->ImplementationLevel());