MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / read

Method read

src/Core/src/FileStream.cpp:160–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158 }
159
160 void FileStream::read(void* buffer, size_t len)
161 {
162 if (_mode != StreamMode::read)
163 {
164 throw Exception::InvalidOperation("Can not read");
165 }
166
167 const auto bytesRead = readFile(buffer, len, _file);
168 if (bytesRead != len)
169 {
170 throw Exception::RuntimeError("Failed to read data");
171 }
172
173 _offset += bytesRead;
174 }
175
176 void FileStream::write(const void* buffer, size_t len)
177 {

Callers 4

loadFromFileMethod · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
Stream.hppFile · 0.45

Calls 1

readFileFunction · 0.85

Tested by 2

TESTFunction · 0.36
TESTFunction · 0.36