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

Method Write

lib/mdflib/mdflib/src/hl4block.cpp:55–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55uint64_t Hl4Block::Write(std::streambuf& buffer) {
56 const bool update =
57 FilePosition() > 0; // Write or update the values inside the block
58 if (update) {
59 // Note that the block_list is used for the dl_list
60 WriteLink4List(buffer, block_list_,kIndexNext,
61 UpdateOption::DoNotUpdateWrittenBlock); // Only save non-updated
62 return block_length_;
63 }
64
65 block_type_ = "##HL";
66 block_length_ = 24 + (1*8) + 2 + 1 + 5;
67 link_list_.resize(1, 0);
68
69 uint64_t bytes = MdfBlock::Write(buffer);
70 bytes += WriteNumber(buffer,flags_);
71 bytes += WriteNumber(buffer,type_);
72 bytes += WriteBytes(buffer, 5);
73 UpdateBlockSize(buffer, bytes);
74
75 WriteLink4List(buffer, block_list_,kIndexNext,
76 UpdateOption::DoNotUpdateWrittenBlock); // Only save non-updated
77 return bytes;
78}
79} // namespace mdf::detail

Callers

nothing calls this directly

Calls 2

WriteBytesFunction · 0.85
resizeMethod · 0.45

Tested by

no test coverage detected