MCPcopy Create free account
hub / github.com/aardappel/lobster / LoadFileFromAny

Function LoadFileFromAny

dev/src/platform.cpp:328–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326string LastAbsPathLoaded() { return last_abs_path_loaded; }
327
328int64_t LoadFileFromAny(string_view filename, string *dest, int64_t start, int64_t len) {
329 if (IsAbsolute(filename)) {
330 // Absolute filename.
331 return cur_loader(last_abs_path_loaded = string(filename), dest, start, len);
332 }
333 for (auto &dir : data_dirs) {
334 auto l = cur_loader(last_abs_path_loaded = dir + filename, dest, start, len);
335 if (l >= 0) return l;
336 }
337 LOG_DEBUG("LoadFileFromAny: ", filename, " file not found");
338 return -1;
339}
340
341// We don't generally load in ways that allow stdio text mode conversions, so this function
342// emulates them at best effort.

Callers 1

LoadFileFunction · 0.85

Calls 1

IsAbsoluteFunction · 0.85

Tested by

no test coverage detected