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

Method Write

lib/mdflib/mdflib/src/si4block.cpp:109–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109uint64_t Si4Block::Write(std::streambuf& buffer) {
110 const bool update = FilePosition() > 0; // True if already written to file
111 if (update) {
112 return block_length_;
113 }
114
115 block_type_ = "##SI";
116 block_length_ = 24 + (3 * 8) + 1 + 1 + 1 + 5;
117 link_list_.resize(3, 0);
118 WriteTx4(buffer, kIndexName, name_);
119 WriteTx4(buffer, kIndexPath, path_);
120 WriteMdComment(buffer, kIndexMd);
121
122 uint64_t bytes = MdfBlock::Write(buffer);
123 bytes += WriteNumber(buffer, type_);
124 bytes += WriteNumber(buffer, bus_type_);
125 bytes += WriteNumber(buffer, flags_);
126 bytes += WriteBytes(buffer, 5);
127 UpdateBlockSize(buffer, bytes);
128 return bytes;
129}
130
131int64_t Si4Block::Index() const { return FilePosition(); }
132

Callers

nothing calls this directly

Calls 2

WriteBytesFunction · 0.85
resizeMethod · 0.45

Tested by

no test coverage detected