19 #ifndef RESOURCE_LOCATOR_H
20 #define RESOURCE_LOCATOR_H
28 #include "generic/lru_cache.h"
29 #include "generic/optional.h"
30 #include "generic/managed.h"
31 #include "utils/unicode.h"
41 std::runtime_error(what) {}
50 std::list<Path>& search_path() {
return resource_path_; }
55 bool fail_silently=
false
57 std::shared_ptr<std::istream> open_file(
const Path& filename);
58 std::shared_ptr<std::stringstream> read_file(
const Path& filename);
59 std::vector<std::string> read_file_lines(
const Path& filename);
61 bool add_search_path(
const Path& path);
62 void remove_search_path(
const Path& path);
65 std::size_t location_cache_size()
const;
68 void clear_location_cache();
71 void set_location_cache_limit(std::size_t entries);
74 Path find_executable_directory();
75 Path find_working_directory();
77 std::list<Path> resource_path_;
84 #endif // RESOURCE_LOCATOR_H