#include #include #include #include void PreloadContext::log(std::shared_ptr logger) { log_ = logger; } std::shared_ptr PreloadContext::log() const { return log_; } void PreloadContext::mountdir(const std::string& path) { assert(is_absolute_path(path)); mountdir_ = path; } std::string PreloadContext::mountdir() const { return mountdir_; } bool PreloadContext::relativize_path(std::string& path) const { if(mountdir_.empty()) { /* Relativize path has been called before the library constructor has been invoked * thus the mountdir has not been set yet */ return false; } if(!is_absolute_path(path)) { /* We don't support path resolution at the moment * thus we don't know how to handle relative path */ return false; } path = path_to_relative(mountdir_, path); return !path.empty(); }