mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-18 01:41:29 -06:00
23 lines
530 B
C++
23 lines
530 B
C++
|
|
#include <iostream>
|
|
#include <regex>
|
|
|
|
#include <ghoul/logging/logmanager.h>
|
|
|
|
namespace openspace::dataloader::helpers {
|
|
namespace {
|
|
constexpr const char* _loggerCat = "Helper";
|
|
}
|
|
|
|
std::string getDirLeaf(std::string dir) {
|
|
std::regex dirLeaf_regex("([^/]+)/?$");
|
|
std::smatch dirLeaf_match;
|
|
|
|
if (std::regex_search(dir, dirLeaf_match, dirLeaf_regex)) {
|
|
return dirLeaf_match[0].str();
|
|
} else {
|
|
LWARNING("Found no match in " + dir + ".");
|
|
}
|
|
}
|
|
}
|