2021-05-28 18:57:15 +02:00
|
|
|
#include "resources.h"
|
|
|
|
|
#include <filesystem>
|
2021-08-19 00:37:25 +02:00
|
|
|
#include "satdump_vars.h"
|
2021-05-28 18:57:15 +02:00
|
|
|
|
|
|
|
|
namespace resources
|
|
|
|
|
{
|
|
|
|
|
std::string res_root = (std::string)RESOURCES_PATH;
|
|
|
|
|
|
|
|
|
|
bool resourceExists(std::string resource)
|
|
|
|
|
{
|
|
|
|
|
if (std::filesystem::exists("resources"))
|
|
|
|
|
return std::filesystem::exists("resources/" + resource);
|
|
|
|
|
else
|
|
|
|
|
return std::filesystem::exists(res_root + "resources/" + resource);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string getResourcePath(std::string resource)
|
|
|
|
|
{
|
|
|
|
|
if (std::filesystem::exists("resources"))
|
|
|
|
|
return "resources/" + resource;
|
|
|
|
|
else
|
|
|
|
|
return res_root + "resources/" + resource;
|
|
|
|
|
}
|
|
|
|
|
}
|