aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs/Path.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/Path.cxx')
-rw-r--r--src/fs/Path.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/fs/Path.cxx b/src/fs/Path.cxx
index 8288a4fec..99a4ffb61 100644
--- a/src/fs/Path.cxx
+++ b/src/fs/Path.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -20,9 +20,22 @@
#include "config.h"
#include "Path.hxx"
#include "Charset.hxx"
+#include "util/UriUtil.hxx"
+#include "util/StringUtil.hxx"
std::string
Path::ToUTF8() const
{
return ::PathToUTF8(c_str());
}
+
+Path::const_pointer
+Path::GetSuffix() const
+{
+ const auto base = GetBase().c_str();
+ const auto *dot = StringFindLast(base, '.');
+ if (dot == nullptr || dot == base)
+ return nullptr;
+
+ return dot + 1;
+}