MCPcopy Create free account
hub / github.com/Niko1221/Strata / read

Method read

engine/src/core/conversation_file.cpp:595–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

593 std::string error() const { return buf_ ? f_.error() : std::string("out of memory for the read buffer"); }
594 SessionError kind() const { return buf_ ? f_.kind() : SessionError::memory; }
595 bool read(void* p, size_t n) {
596 uint8_t* d = static_cast<uint8_t*>(p);
597 while (n) {
598 if (at_ == have_ && !fill()) return false;
599 const size_t c = std::min(n, have_ - at_);
600 std::memcpy(d, buf_.get() + at_, c);
601 at_ += c; d += c; n -= c;
602 }
603 return true;
604 }
605 std::optional<Ticker> progress;
606 uint64_t expected = 0;
607private:

Callers 15

sourceMethod · 0.45
rawMethod · 0.45
read_implFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
hash_small_fileFunction · 0.45
hash_sampled_fileFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
read_valueFunction · 0.45

Calls 4

memcpyFunction · 0.85
getMethod · 0.65
fillFunction · 0.50
minFunction · 0.50

Tested by 7

mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
fixtureFunction · 0.36
swap_transfer_failureFunction · 0.36