MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / Write

Method Write

lib/mdflib/mdflib/src/idblock.cpp:95–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95uint64_t IdBlock::Write(std::streambuf& buffer) {
96 // Check if it has been written. Update is not supported in ID
97 if (FilePosition() == 0) {
98 return 64;
99 }
100
101 // Do not call MdfBlock::Write(file) as the other block writes do
102
103 SetFirstFilePosition(buffer);
104 file_position_ = GetFilePosition(buffer);
105 uint64_t bytes = WriteStr(buffer, file_identifier_, 8);
106 bytes += WriteStr(buffer, format_identifier_, 8);
107 bytes += WriteStr(buffer, program_identifier_, 8);
108 bytes += WriteNumber(buffer, byte_order_);
109 bytes += WriteNumber(buffer, floating_point_format_);
110 bytes += WriteNumber(buffer, version_);
111 bytes += WriteNumber(buffer, code_page_number_);
112 std::vector<uint8_t> reserved(28, 0);
113 bytes += WriteByte(buffer, reserved);
114 bytes += WriteNumber(buffer, standard_flags_);
115 bytes += WriteNumber(buffer, custom_flags_);
116 if (bytes != 64) {
117 throw std::runtime_error("ID block not 64 bytes");
118 }
119 return bytes;
120}
121
122std::string IdBlock::FileId() const {
123 std::string temp = file_identifier_;

Callers 15

OnCloseMethod · 0.45
TestBusLoggingMethod · 0.45
WriteBlockListMethod · 0.45
WriteRootMethod · 0.45
SaveQueueMethod · 0.45
CleanQueueCompressedMethod · 0.45
SaveQueueMethod · 0.45
CleanQueueCompressedMethod · 0.45
InitMeasurementMethod · 0.45
FinalizeMeasurementMethod · 0.45
CleanQueueMethod · 0.45
WriteBlock4Method · 0.45

Calls 4

SetFirstFilePositionFunction · 0.85
GetFilePositionFunction · 0.85
WriteStrFunction · 0.85
WriteByteFunction · 0.85

Tested by 1

TestBusLoggingMethod · 0.36