MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / Read

Method Read

Sources/Shared/IO/BoundedFileStream.cpp:48–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 }
47
48 std::int64_t BoundedFileStream::Read(void* destination, std::int64_t bytesToRead)
49 {
50 if (bytesToRead <= 0) {
51 return 0;
52 }
53
54 DEATH_ASSERT(destination != nullptr, "destination is null", 0);
55
56 std::int64_t pos = _underlyingStream.GetPosition() - _offset;
57 if (bytesToRead > static_cast<std::int64_t>(_size) - pos) {
58 bytesToRead = static_cast<std::int64_t>(_size) - pos;
59 }
60
61 return _underlyingStream.Read(destination, bytesToRead);
62 }
63
64 std::int64_t BoundedFileStream::Write(const void* source, std::int64_t bytesToWrite)
65 {

Callers

nothing calls this directly

Calls 2

DEATH_ASSERTFunction · 0.85
GetPositionMethod · 0.45

Tested by

no test coverage detected