2 #include <RWHeaderSection_RWFileSchema.ixx>
3 #include <Interface_HArray1OfHAsciiString.hxx>
6 RWHeaderSection_RWFileSchema::RWHeaderSection_RWFileSchema () {}
8 void RWHeaderSection_RWFileSchema::ReadStep
9 (const Handle(StepData_StepReaderData)& data,
10 const Standard_Integer num,
11 Handle(Interface_Check)& ach,
12 const Handle(HeaderSection_FileSchema)& ent) const
16 // --- Number of Parameter Control ---
18 if (!data->CheckNbParams(num,1,ach,"file_schema has not 1 parameter(s)")) return;
20 // --- own field : schemaIdentifiers ---
22 Handle(Interface_HArray1OfHAsciiString) aSchemaIdentifiers;
23 Handle(TCollection_HAsciiString) aSchemaIdentifiersItem;
24 Standard_Integer nsub1;
25 nsub1 = data->SubListNumber(num, 1, Standard_False);
27 Standard_Integer nb1 = data->NbParams(nsub1);
28 aSchemaIdentifiers = new Interface_HArray1OfHAsciiString (1, nb1);
29 for (Standard_Integer i1 = 1; i1 <= nb1; i1 ++) {
30 Standard_Boolean stat1 = data->ReadString
31 (nsub1,i1,"schema_identifiers",ach,aSchemaIdentifiersItem);
32 if (stat1) aSchemaIdentifiers->SetValue(i1,aSchemaIdentifiersItem);
36 ach->AddFail("Parameter #1 (schema_identifiers) is not a LIST");
39 //--- Initialisation of the read entity ---
42 if (!ach->HasFailed()) ent->Init(aSchemaIdentifiers);
46 void RWHeaderSection_RWFileSchema::WriteStep
47 (StepData_StepWriter& SW,
48 const Handle(HeaderSection_FileSchema)& ent) const
51 // --- own field : schemaIdentifiers ---
54 for (Standard_Integer i1 = 1; i1 <= ent->NbSchemaIdentifiers(); i1 ++) {
55 SW.Send(ent->SchemaIdentifiersValue(i1));