Add helper getDataFilePath()

Used to get absolute file path to files in the plugin's data directory
This commit is contained in:
WarmUpTill
2021-06-01 21:09:53 +02:00
committed by WarmUpTill
parent b9f6e47a49
commit 38161f63a3
2 changed files with 13 additions and 0 deletions

View File

@@ -218,6 +218,17 @@ std::string getSourceSettings(OBSWeakSource ws)
return settings;
}
std::filesystem::path getDataFilePath(const std::string &file)
{
const char *root_path = obs_get_module_data_path(obs_current_module());
if (root_path) {
auto ret = std::filesystem::u8path(root_path);
ret.append(file.data());
return ret;
}
return "";
}
bool DisplayMessage(const QString &msg, bool question)
{
if (question) {