0022627: Change OCCT memory management defaults
[occt.git] / src / RWStepBasic / RWStepBasic_RWProductCategory.cxx
CommitLineData
7fd59977 1
2#include <RWStepBasic_RWProductCategory.ixx>
3
4
5RWStepBasic_RWProductCategory::RWStepBasic_RWProductCategory () {}
6
7void RWStepBasic_RWProductCategory::ReadStep
8 (const Handle(StepData_StepReaderData)& data,
9 const Standard_Integer num,
10 Handle(Interface_Check)& ach,
11 const Handle(StepBasic_ProductCategory)& ent) const
12{
13
14
15 // --- Number of Parameter Control ---
16
17 if (!data->CheckNbParams(num,2,ach,"product_category")) return;
18
19 // --- own field : name ---
20
21 Handle(TCollection_HAsciiString) aName;
22 //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
23 data->ReadString (num,1,"name",ach,aName);
24
25 // --- own field : description ---
26
27 Handle(TCollection_HAsciiString) aDescription;
28 Standard_Boolean hasAdescription = Standard_True;
29 if (data->IsParamDefined(num,2)) {
30 //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed
31 data->ReadString (num,2,"description",ach,aDescription);
32 }
33 else {
34 hasAdescription = Standard_False;
35 aDescription.Nullify();
36 }
37
38 //--- Initialisation of the read entity ---
39
40
41 ent->Init(aName, hasAdescription, aDescription);
42}
43
44
45void RWStepBasic_RWProductCategory::WriteStep
46 (StepData_StepWriter& SW,
47 const Handle(StepBasic_ProductCategory)& ent) const
48{
49
50 // --- own field : name ---
51
52 SW.Send(ent->Name());
53
54 // --- own field : description ---
55
56 Standard_Boolean hasAdescription = ent->HasDescription();
57 if (hasAdescription) {
58 SW.Send(ent->Description());
59 }
60 else {
61 SW.SendUndef();
62 }
63}