add io::path.normalized()

This commit is contained in:
MihailRis
2025-02-04 14:58:41 +03:00
parent 1ec8f89599
commit 59f46ad530
5 changed files with 39 additions and 35 deletions
+9
View File
@@ -1,9 +1,16 @@
#pragma once
#include <string>
#include <stdexcept>
#include <filesystem>
namespace io {
class access_error : public std::runtime_error {
public:
access_error(const std::string& msg) : std::runtime_error(msg) {
}
};
/// @brief std::filesystem::path project-specific alternative having
/// `entry_point:path` scheme and solving std::filesystem::path problems:
/// - implicit std::string conversions depending on compiler
@@ -115,6 +122,8 @@ namespace io {
return str.substr(0, slashpos);
}
path normalized() const;
std::string string() const {
return str;
}