| 1 | |
| 2 | #include <RWStepBasic_RWAddress.ixx> |
| 3 | |
| 4 | |
| 5 | RWStepBasic_RWAddress::RWStepBasic_RWAddress () {} |
| 6 | |
| 7 | void RWStepBasic_RWAddress::ReadStep |
| 8 | (const Handle(StepData_StepReaderData)& data, |
| 9 | const Standard_Integer num, |
| 10 | Handle(Interface_Check)& ach, |
| 11 | const Handle(StepBasic_Address)& ent) const |
| 12 | { |
| 13 | |
| 14 | |
| 15 | // --- Number of Parameter Control --- |
| 16 | |
| 17 | if (!data->CheckNbParams(num,12,ach,"address")) return; |
| 18 | // --- own field : internalLocation --- |
| 19 | |
| 20 | Handle(TCollection_HAsciiString) aInternalLocation; |
| 21 | Standard_Boolean hasAinternalLocation = Standard_True; |
| 22 | if (data->IsParamDefined(num,1)) { |
| 23 | //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed |
| 24 | data->ReadString (num,1,"internal_location",ach,aInternalLocation); |
| 25 | } |
| 26 | else { |
| 27 | hasAinternalLocation = Standard_False; |
| 28 | aInternalLocation.Nullify(); |
| 29 | } |
| 30 | |
| 31 | // --- own field : streetNumber --- |
| 32 | |
| 33 | Handle(TCollection_HAsciiString) aStreetNumber; |
| 34 | Standard_Boolean hasAstreetNumber = Standard_True; |
| 35 | if (data->IsParamDefined(num,2)) { |
| 36 | //szv#4:S4163:12Mar99 `Standard_Boolean stat2 =` not needed |
| 37 | data->ReadString (num,2,"street_number",ach,aStreetNumber); |
| 38 | } |
| 39 | else { |
| 40 | hasAstreetNumber = Standard_False; |
| 41 | aStreetNumber.Nullify(); |
| 42 | } |
| 43 | |
| 44 | // --- own field : street --- |
| 45 | |
| 46 | Handle(TCollection_HAsciiString) aStreet; |
| 47 | Standard_Boolean hasAstreet = Standard_True; |
| 48 | if (data->IsParamDefined(num,3)) { |
| 49 | //szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed |
| 50 | data->ReadString (num,3,"street",ach,aStreet); |
| 51 | } |
| 52 | else { |
| 53 | hasAstreet = Standard_False; |
| 54 | aStreet.Nullify(); |
| 55 | } |
| 56 | |
| 57 | // --- own field : postalBox --- |
| 58 | |
| 59 | Handle(TCollection_HAsciiString) aPostalBox; |
| 60 | Standard_Boolean hasApostalBox = Standard_True; |
| 61 | if (data->IsParamDefined(num,4)) { |
| 62 | //szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed |
| 63 | data->ReadString (num,4,"postal_box",ach,aPostalBox); |
| 64 | } |
| 65 | else { |
| 66 | hasApostalBox = Standard_False; |
| 67 | aPostalBox.Nullify(); |
| 68 | } |
| 69 | |
| 70 | // --- own field : town --- |
| 71 | |
| 72 | Handle(TCollection_HAsciiString) aTown; |
| 73 | Standard_Boolean hasAtown = Standard_True; |
| 74 | if (data->IsParamDefined(num,5)) { |
| 75 | //szv#4:S4163:12Mar99 `Standard_Boolean stat5 =` not needed |
| 76 | data->ReadString (num,5,"town",ach,aTown); |
| 77 | } |
| 78 | else { |
| 79 | hasAtown = Standard_False; |
| 80 | aTown.Nullify(); |
| 81 | } |
| 82 | |
| 83 | // --- own field : region --- |
| 84 | |
| 85 | Handle(TCollection_HAsciiString) aRegion; |
| 86 | Standard_Boolean hasAregion = Standard_True; |
| 87 | if (data->IsParamDefined(num,6)) { |
| 88 | //szv#4:S4163:12Mar99 `Standard_Boolean stat6 =` not needed |
| 89 | data->ReadString (num,6,"region",ach,aRegion); |
| 90 | } |
| 91 | else { |
| 92 | hasAregion = Standard_False; |
| 93 | aRegion.Nullify(); |
| 94 | } |
| 95 | |
| 96 | // --- own field : postalCode --- |
| 97 | |
| 98 | Handle(TCollection_HAsciiString) aPostalCode; |
| 99 | Standard_Boolean hasApostalCode = Standard_True; |
| 100 | if (data->IsParamDefined(num,7)) { |
| 101 | //szv#4:S4163:12Mar99 `Standard_Boolean stat7 =` not needed |
| 102 | data->ReadString (num,7,"postal_code",ach,aPostalCode); |
| 103 | } |
| 104 | else { |
| 105 | hasApostalCode = Standard_False; |
| 106 | aPostalCode.Nullify(); |
| 107 | } |
| 108 | |
| 109 | // --- own field : country --- |
| 110 | |
| 111 | Handle(TCollection_HAsciiString) aCountry; |
| 112 | Standard_Boolean hasAcountry = Standard_True; |
| 113 | if (data->IsParamDefined(num,8)) { |
| 114 | //szv#4:S4163:12Mar99 `Standard_Boolean stat8 =` not needed |
| 115 | data->ReadString (num,8,"country",ach,aCountry); |
| 116 | } |
| 117 | else { |
| 118 | hasAcountry = Standard_False; |
| 119 | aCountry.Nullify(); |
| 120 | } |
| 121 | |
| 122 | // --- own field : facsimileNumber --- |
| 123 | |
| 124 | Handle(TCollection_HAsciiString) aFacsimileNumber; |
| 125 | Standard_Boolean hasAfacsimileNumber = Standard_True; |
| 126 | if (data->IsParamDefined(num,9)) { |
| 127 | //szv#4:S4163:12Mar99 `Standard_Boolean stat9 =` not needed |
| 128 | data->ReadString (num,9,"facsimile_number",ach,aFacsimileNumber); |
| 129 | } |
| 130 | else { |
| 131 | hasAfacsimileNumber = Standard_False; |
| 132 | aFacsimileNumber.Nullify(); |
| 133 | } |
| 134 | |
| 135 | // --- own field : telephoneNumber --- |
| 136 | |
| 137 | Handle(TCollection_HAsciiString) aTelephoneNumber; |
| 138 | Standard_Boolean hasAtelephoneNumber = Standard_True; |
| 139 | if (data->IsParamDefined(num,10)) { |
| 140 | //szv#4:S4163:12Mar99 `Standard_Boolean stat10 =` not needed |
| 141 | data->ReadString (num,10,"telephone_number",ach,aTelephoneNumber); |
| 142 | } |
| 143 | else { |
| 144 | hasAtelephoneNumber = Standard_False; |
| 145 | aTelephoneNumber.Nullify(); |
| 146 | } |
| 147 | |
| 148 | // --- own field : electronicMailAddress --- |
| 149 | |
| 150 | Handle(TCollection_HAsciiString) aElectronicMailAddress; |
| 151 | Standard_Boolean hasAelectronicMailAddress = Standard_True; |
| 152 | if (data->IsParamDefined(num,11)) { |
| 153 | //szv#4:S4163:12Mar99 `Standard_Boolean stat11 =` not needed |
| 154 | data->ReadString (num,11,"electronic_mail_address",ach,aElectronicMailAddress); |
| 155 | } |
| 156 | else { |
| 157 | hasAelectronicMailAddress = Standard_False; |
| 158 | aElectronicMailAddress.Nullify(); |
| 159 | } |
| 160 | |
| 161 | // --- own field : telexNumber --- |
| 162 | |
| 163 | Handle(TCollection_HAsciiString) aTelexNumber; |
| 164 | Standard_Boolean hasAtelexNumber = Standard_True; |
| 165 | if (data->IsParamDefined(num,12)) { |
| 166 | //szv#4:S4163:12Mar99 `Standard_Boolean stat12 =` not needed |
| 167 | data->ReadString (num,12,"telex_number",ach,aTelexNumber); |
| 168 | } |
| 169 | else { |
| 170 | hasAtelexNumber = Standard_False; |
| 171 | aTelexNumber.Nullify(); |
| 172 | } |
| 173 | |
| 174 | //--- Initialisation of the read entity --- |
| 175 | |
| 176 | |
| 177 | ent->Init(hasAinternalLocation, aInternalLocation, hasAstreetNumber, aStreetNumber, hasAstreet, aStreet, hasApostalBox, aPostalBox, hasAtown, aTown, hasAregion, aRegion, hasApostalCode, aPostalCode, hasAcountry, aCountry, hasAfacsimileNumber, aFacsimileNumber, hasAtelephoneNumber, aTelephoneNumber, hasAelectronicMailAddress, aElectronicMailAddress, hasAtelexNumber, aTelexNumber); |
| 178 | } |
| 179 | |
| 180 | |
| 181 | void RWStepBasic_RWAddress::WriteStep |
| 182 | (StepData_StepWriter& SW, |
| 183 | const Handle(StepBasic_Address)& ent) const |
| 184 | { |
| 185 | |
| 186 | // --- own field : internalLocation --- |
| 187 | |
| 188 | Standard_Boolean hasAinternalLocation = ent->HasInternalLocation(); |
| 189 | if (hasAinternalLocation) { |
| 190 | SW.Send(ent->InternalLocation()); |
| 191 | } |
| 192 | else { |
| 193 | SW.SendUndef(); |
| 194 | } |
| 195 | |
| 196 | // --- own field : streetNumber --- |
| 197 | |
| 198 | Standard_Boolean hasAstreetNumber = ent->HasStreetNumber(); |
| 199 | if (hasAstreetNumber) { |
| 200 | SW.Send(ent->StreetNumber()); |
| 201 | } |
| 202 | else { |
| 203 | SW.SendUndef(); |
| 204 | } |
| 205 | |
| 206 | // --- own field : street --- |
| 207 | |
| 208 | Standard_Boolean hasAstreet = ent->HasStreet(); |
| 209 | if (hasAstreet) { |
| 210 | SW.Send(ent->Street()); |
| 211 | } |
| 212 | else { |
| 213 | SW.SendUndef(); |
| 214 | } |
| 215 | |
| 216 | // --- own field : postalBox --- |
| 217 | |
| 218 | Standard_Boolean hasApostalBox = ent->HasPostalBox(); |
| 219 | if (hasApostalBox) { |
| 220 | SW.Send(ent->PostalBox()); |
| 221 | } |
| 222 | else { |
| 223 | SW.SendUndef(); |
| 224 | } |
| 225 | |
| 226 | // --- own field : town --- |
| 227 | |
| 228 | Standard_Boolean hasAtown = ent->HasTown(); |
| 229 | if (hasAtown) { |
| 230 | SW.Send(ent->Town()); |
| 231 | } |
| 232 | else { |
| 233 | SW.SendUndef(); |
| 234 | } |
| 235 | |
| 236 | // --- own field : region --- |
| 237 | |
| 238 | Standard_Boolean hasAregion = ent->HasRegion(); |
| 239 | if (hasAregion) { |
| 240 | SW.Send(ent->Region()); |
| 241 | } |
| 242 | else { |
| 243 | SW.SendUndef(); |
| 244 | } |
| 245 | |
| 246 | // --- own field : postalCode --- |
| 247 | |
| 248 | Standard_Boolean hasApostalCode = ent->HasPostalCode(); |
| 249 | if (hasApostalCode) { |
| 250 | SW.Send(ent->PostalCode()); |
| 251 | } |
| 252 | else { |
| 253 | SW.SendUndef(); |
| 254 | } |
| 255 | |
| 256 | // --- own field : country --- |
| 257 | |
| 258 | Standard_Boolean hasAcountry = ent->HasCountry(); |
| 259 | if (hasAcountry) { |
| 260 | SW.Send(ent->Country()); |
| 261 | } |
| 262 | else { |
| 263 | SW.SendUndef(); |
| 264 | } |
| 265 | |
| 266 | // --- own field : facsimileNumber --- |
| 267 | |
| 268 | Standard_Boolean hasAfacsimileNumber = ent->HasFacsimileNumber(); |
| 269 | if (hasAfacsimileNumber) { |
| 270 | SW.Send(ent->FacsimileNumber()); |
| 271 | } |
| 272 | else { |
| 273 | SW.SendUndef(); |
| 274 | } |
| 275 | |
| 276 | // --- own field : telephoneNumber --- |
| 277 | |
| 278 | Standard_Boolean hasAtelephoneNumber = ent->HasTelephoneNumber(); |
| 279 | if (hasAtelephoneNumber) { |
| 280 | SW.Send(ent->TelephoneNumber()); |
| 281 | } |
| 282 | else { |
| 283 | SW.SendUndef(); |
| 284 | } |
| 285 | |
| 286 | // --- own field : electronicMailAddress --- |
| 287 | |
| 288 | Standard_Boolean hasAelectronicMailAddress = ent->HasElectronicMailAddress(); |
| 289 | if (hasAelectronicMailAddress) { |
| 290 | SW.Send(ent->ElectronicMailAddress()); |
| 291 | } |
| 292 | else { |
| 293 | SW.SendUndef(); |
| 294 | } |
| 295 | |
| 296 | // --- own field : telexNumber --- |
| 297 | |
| 298 | Standard_Boolean hasAtelexNumber = ent->HasTelexNumber(); |
| 299 | if (hasAtelexNumber) { |
| 300 | SW.Send(ent->TelexNumber()); |
| 301 | } |
| 302 | else { |
| 303 | SW.SendUndef(); |
| 304 | } |
| 305 | } |