diff options
Diffstat (limited to '')
-rw-r--r-- | src/fs/Path.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/fs/Path.cxx b/src/fs/Path.cxx index f04823661..9fdb78d35 100644 --- a/src/fs/Path.cxx +++ b/src/fs/Path.cxx @@ -52,6 +52,20 @@ const Domain path_domain("path"); std::string fs_charset; +inline Path::Path(Donate, pointer _value) + :value(_value) { + g_free(_value); +} + +/* no inlining, please */ +Path::~Path() {} + +Path +Path::Build(const_pointer a, const_pointer b) +{ + return Path(Donate(), g_build_filename(a, b, nullptr)); +} + std::string Path::ToUTF8(const_pointer path_fs) { if (path_fs == nullptr) @@ -102,6 +116,12 @@ Path::FromUTF8(const char *path_utf8, Error &error) return path; } +Path +Path::GetDirectoryName() const +{ + return Path(Donate(), g_path_get_dirname(value.c_str())); +} + gcc_pure static bool IsSupportedCharset(const char *charset) |