MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / readFile

Method readFile

source/core/StarFile.cpp:55–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55ByteArray File::readFile(String const& filename) {
56 FilePtr file = File::open(filename, IOMode::Read);
57 ByteArray bytes;
58 while (!file->atEnd()) {
59 char buffer[1024];
60 size_t r = file->read(buffer, 1024);
61 bytes.append(buffer, r);
62 }
63
64 return bytes;
65}
66
67String File::readFileString(String const& filename) {
68 FilePtr file = File::open(filename, IOMode::Read);

Callers

nothing calls this directly

Calls 3

atEndMethod · 0.45
readMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected