2 #include <RWHeaderSection_RWFileDescription.ixx>
3 #include <Interface_HArray1OfHAsciiString.hxx>
6 RWHeaderSection_RWFileDescription::RWHeaderSection_RWFileDescription () {}
8 void RWHeaderSection_RWFileDescription::ReadStep
9 (const Handle(StepData_StepReaderData)& data,
10 const Standard_Integer num,
11 Handle(Interface_Check)& ach,
12 const Handle(HeaderSection_FileDescription)& ent) const
16 // --- Number of Parameter Control ---
18 if (!data->CheckNbParams(num,2,ach,"file_description has not 2 parameter(s)")) return;
20 // --- own field : description ---
22 Handle(Interface_HArray1OfHAsciiString) aDescription;
23 Handle(TCollection_HAsciiString) aDescriptionItem;
24 Standard_Integer nsub1;
25 nsub1 = data->SubListNumber(num, 1, Standard_False);
27 Standard_Integer nb1 = data->NbParams(nsub1);
28 aDescription = new Interface_HArray1OfHAsciiString (1, nb1);
29 for (Standard_Integer i1 = 1; i1 <= nb1; i1 ++) {
30 Standard_Boolean stat1 = data->ReadString
31 (nsub1,i1,"description",ach,aDescriptionItem);
32 if (stat1) aDescription->SetValue(i1,aDescriptionItem);
36 ach->AddFail("Parameter #1 (description) is not a LIST");
39 // --- own field : implementationLevel ---
41 Handle(TCollection_HAsciiString) aImplementationLevel;
42 Standard_Boolean stat2;
43 stat2 = data->ReadString (num,2,"implementation_level",ach,aImplementationLevel);
45 //--- Initialisation of the read entity ---
48 if (!ach->HasFailed()) ent->Init(aDescription, aImplementationLevel);
52 void RWHeaderSection_RWFileDescription::WriteStep
53 (StepData_StepWriter& SW,
54 const Handle(HeaderSection_FileDescription)& ent) const
57 // --- own field : description ---
60 for (Standard_Integer i1 = 1; i1 <= ent->NbDescription(); i1 ++) {
61 SW.Send(ent->DescriptionValue(i1));
65 // --- own field : implementationLevel ---
67 SW.Send(ent->ImplementationLevel());