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

Method Write

lib/mdflib/mdflib/src/tx4block.cpp:83–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83uint64_t Tx4Block::Write(std::streambuf& buffer) {
84 const bool update = FilePosition() > 0;
85 if (update) {
86 return block_size_;
87 }
88 const bool is_xml = !text_.empty() && text_[0] == '<';
89 block_type_ = is_xml ? "##MD" : "##TX";
90 block_size_ = static_cast<uint16_t>(24 + text_.size() + 1);
91 link_list_.clear();
92
93 uint64_t bytes = MdfBlock::Write(buffer);
94 bytes += WriteStr(buffer, text_, text_.size());
95 bytes += WriteBytes(buffer, 1);
96 UpdateBlockSize(buffer, bytes);
97 return bytes;
98}
99
100std::string Tx4Block::Text() const {
101 std::string temp = text_;

Callers

nothing calls this directly

Calls 5

WriteStrFunction · 0.85
WriteBytesFunction · 0.85
emptyMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected