| 152 | } |
| 153 | |
| 154 | Buffer 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 | |
| 173 | Buffer CompileOptions::read_optional(const char *path) |
| 174 | { |
no test coverage detected