From bde4a9f40bb4af39270a124d5ef9571a83305d0a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 30 Jan 2021 20:36:42 +0000 Subject: Restructure to allow a resource path and testing --- lib/resource.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/resource.cpp (limited to 'lib/resource.cpp') diff --git a/lib/resource.cpp b/lib/resource.cpp new file mode 100644 index 0000000..b9aa4fa --- /dev/null +++ b/lib/resource.cpp @@ -0,0 +1,16 @@ +#include "resource.h" +#include + +std::filesystem::path base {std::filesystem::current_path() / "res"}; + +void +Resource::setBasePath(std::filesystem::path newbase) +{ + base = std::move(newbase); +} + +std::filesystem::path +Resource::mapPath(const std::filesystem::path & rel) +{ + return std::filesystem::canonical(base / rel); +} -- cgit v1.2.3