| 29 | } |
| 30 | |
| 31 | void SystemVariable::write(AbstractFile & os) { |
| 32 | /* pre processing */ |
| 33 | nameLength = static_cast<uint32_t>(name.size()); |
| 34 | dataLength = static_cast<uint32_t>(data.size()); |
| 35 | |
| 36 | ObjectHeader::write(os); |
| 37 | os.write(reinterpret_cast<char *>(&type), sizeof(type)); |
| 38 | os.write(reinterpret_cast<char *>(&representation), sizeof(representation)); |
| 39 | os.write(reinterpret_cast<char *>(&reservedSystemVariable1), sizeof(reservedSystemVariable1)); |
| 40 | os.write(reinterpret_cast<char *>(&nameLength), sizeof(nameLength)); |
| 41 | os.write(reinterpret_cast<char *>(&dataLength), sizeof(dataLength)); |
| 42 | os.write(reinterpret_cast<char *>(&reservedSystemVariable2), sizeof(reservedSystemVariable2)); |
| 43 | os.write(const_cast<char *>(name.data()), nameLength); |
| 44 | os.write(reinterpret_cast<char *>(data.data()), dataLength); |
| 45 | |
| 46 | /* skip padding */ |
| 47 | os.skipp(objectSize % 4); |
| 48 | } |
| 49 | |
| 50 | uint32_t SystemVariable::calculateObjectSize() const { |
| 51 | return |