aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-02-02 19:28:02 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-02-02 19:28:02 +0600
commit17dca254a3f451ffb1494375bbb3e67bc699d191 (patch)
tree0ff08108b31e3a7724d0c64c9b29956401bc7b55
parentf6b50d23872302b8e3129bd169201463d326e6fd (diff)
downloadmpd-17dca254a3f451ffb1494375bbb3e67bc699d191.tar.gz
mpd-17dca254a3f451ffb1494375bbb3e67bc699d191.tar.xz
mpd-17dca254a3f451ffb1494375bbb3e67bc699d191.zip
Path.hxx: add GetDirectoryName() method
-rw-r--r--src/fs/Path.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx
index 8635d12a9..eaab2bde5 100644
--- a/src/fs/Path.hxx
+++ b/src/fs/Path.hxx
@@ -253,6 +253,15 @@ public:
std::string ToUTF8() const {
return ToUTF8(value);
}
+
+ /**
+ * Gets directory name of this path.
+ * Returns a "nulled" instance on error.
+ */
+ Path GetDirectoryName() const {
+ assert(value != nullptr);
+ return Path(Donate(), g_path_get_dirname(value));
+ }
};
#endif