MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ReadInternal

Method ReadInternal

src/script/squirrel.cpp:554–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552 StringConsumer consumer;
553
554 size_t ReadInternal(std::span<char> buf)
555 {
556 size_t count = buf.size();
557 if (this->pos + count > this->size) {
558 count = this->size - this->pos;
559 }
560 if (count > 0) count = fread(buf.data(), 1, count, this->file);
561 this->pos += count;
562 return count;
563 }
564
565public:
566 SQFile(FileHandle file, size_t size) : file(std::move(file)), size(size), pos(0), consumer(buffer) {}

Callers 2

SQFileClass · 0.95
ReadMethod · 0.95

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected