MCPcopy Create free account
hub / github.com/crownengine/crown / read

Method read

src/resource/compile_options.cpp:154–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154Buffer CompileOptions::read(const char *path)
155{
156 fake_read(path);
157
158 TempAllocator256 ta;
159 DynamicString source_dir(ta);
160 _data_compiler.source_dir(path, source_dir);
161
162 FilesystemDisk source_filesystem(ta);
163 source_filesystem.set_prefix(source_dir.c_str());
164
165 Buffer buf(default_allocator());
166 File *file = source_filesystem.open(path, FileOpenMode::READ);
167 if (file->is_open())
168 file->read_all(buf);
169 source_filesystem.close(*file);
170 return buf;
171}
172
173Buffer CompileOptions::read_optional(const char *path)
174{

Callers 15

compileFunction · 0.45
loadFunction · 0.45
compileFunction · 0.45
compileFunction · 0.45
loadFunction · 0.45
compileFunction · 0.45
read_outputMethod · 0.45
compileFunction · 0.45
parse_internalFunction · 0.45
parseFunction · 0.45
parse_internalFunction · 0.45
parseFunction · 0.45

Calls 8

source_dirMethod · 0.80
set_prefixMethod · 0.80
read_allMethod · 0.80
readFunction · 0.50
c_strMethod · 0.45
openMethod · 0.45
is_openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected