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

Method Read

lib/mdflib/mdflib/src/at4block.cpp:146–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146uint64_t At4Block::Read(std::streambuf& buffer) {
147 uint64_t bytes = ReadHeader4(buffer);
148 bytes += ReadNumber(buffer, flags_);
149 bytes += ReadNumber(buffer, creator_index_);
150 std::vector<uint8_t> reserved;
151 bytes += ReadByte(buffer, reserved, 4);
152 bytes += ReadByte(buffer, md5_, 16);
153 bytes += ReadNumber(buffer, original_size_);
154 bytes += ReadNumber(buffer, nof_bytes_);
155 // Do not read in the data BLOB at this point but store the file position for
156 // that data, so it is fast to get the data later
157 data_position_ = GetFilePosition(buffer);
158
159 filename_ = ReadTx4(buffer, kIndexFilename);
160 file_type_ = ReadTx4(buffer, kIndexType);
161 ReadMdComment(buffer, kIndexMd);
162
163 return bytes;
164}
165
166uint64_t At4Block::Write(std::streambuf& buffer) {
167 const bool update = FilePosition() > 0;

Callers

nothing calls this directly

Calls 2

ReadByteFunction · 0.85
GetFilePositionFunction · 0.85

Tested by

no test coverage detected