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

Method Write

lib/mdflib/mdflib/src/dz4block.cpp:56–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56uint64_t Dz4Block::Write(std::streambuf& buffer) {
57 const bool update = FilePosition() > 0;
58 if (update) {
59 // The DZ block properties cannot be changed after it has been written
60 return block_length_;
61 }
62
63 block_type_ = "##DZ";
64 link_list_.clear();
65 block_length_ = 24 + 2 + 1 + 1 + 4 + 8 + 8 + data_length_;
66
67 uint64_t bytes = MdfBlock::Write(buffer);
68 bytes += WriteStr(buffer, orig_block_type_, 2);
69 bytes += WriteNumber(buffer, type_);
70 bytes += WriteBytes(buffer, 1);
71 bytes += WriteNumber(buffer, parameter_);
72 bytes += WriteNumber(buffer, orig_data_length_);
73 bytes += WriteNumber(buffer, data_length_);
74 bytes += WriteByte(buffer,data_);
75 UpdateBlockSize(buffer, bytes);
76
77 return bytes;
78}
79
80uint64_t Dz4Block::CopyDataToFile(std::streambuf& from_file,
81 std::streambuf& to_file) const {

Callers

nothing calls this directly

Calls 4

WriteStrFunction · 0.85
WriteBytesFunction · 0.85
WriteByteFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected