diff --git a/src/fs/AllocatedPath.cxx b/src/fs/AllocatedPath.cxx index 2c94b37ce..afae0c872 100644 --- a/src/fs/AllocatedPath.cxx +++ b/src/fs/AllocatedPath.cxx @@ -52,22 +52,6 @@ AllocatedPath::FromUTF8Throw(const char *path_utf8) #endif } -AllocatedPath -AllocatedPath::GetDirectoryName() const noexcept -{ - return FromFS(PathTraitsFS::GetParent(c_str())); -} - -std::string -AllocatedPath::ToUTF8() const noexcept -{ - try { - return ::PathToUTF8(c_str()); - } catch (...) { - return std::string(); - } -} - void AllocatedPath::ChopSeparators() noexcept { diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx index e15460e9a..d9af53bfd 100644 --- a/src/fs/AllocatedPath.hxx +++ b/src/fs/AllocatedPath.hxx @@ -249,14 +249,18 @@ public: * (#IsNull returns true). */ gcc_pure - std::string ToUTF8() const noexcept; + std::string ToUTF8() const noexcept { + return ((Path)*this).ToUTF8(); + } /** * Gets directory name of this path. * Returns a "nulled" instance on error. */ gcc_pure - AllocatedPath GetDirectoryName() const noexcept; + AllocatedPath GetDirectoryName() const noexcept { + return ((Path)*this).GetDirectoryName(); + } /** * Determine the relative part of the given path to this