23 inline std::string
basename(
const std::string& file)
26 return file.substr(file.find_last_of(
"\\/") + 1);
38 inline std::filesystem::path
to_path(
const std::string& s)
43 return std::filesystem::path(std::u8string(
reinterpret_cast<const char8_t*
>(s.data()), s.size()));
45 catch (
const std::system_error&)
48 return std::filesystem::path(s);
51 return std::filesystem::path(std::u8string(
reinterpret_cast<const char8_t*
>(s.data()), s.size()));
std::string basename(const std::string &file)
Return the basename using either slash style on every platform.
Definition PathUtils.h:23
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::filesystem::path to_path(const std::string &s)
Definition PathUtils.h:38