aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistInfo.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-02 22:16:52 +0100
committerMax Kellermann <max@duempel.org>2013-01-03 02:25:06 +0100
commit9023ba4a81d597c8694432655833cf23d83c6cde (patch)
tree304c2465ea160297dff17302f36c4cc38687ccb6 /src/PlaylistInfo.hxx
parent83488848e1091024a0a307b1539c1a85762ee1f1 (diff)
downloadmpd-9023ba4a81d597c8694432655833cf23d83c6cde.tar.gz
mpd-9023ba4a81d597c8694432655833cf23d83c6cde.tar.xz
mpd-9023ba4a81d597c8694432655833cf23d83c6cde.zip
PlaylistVector: use std::list
Diffstat (limited to 'src/PlaylistInfo.hxx')
-rw-r--r--src/PlaylistInfo.hxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/PlaylistInfo.hxx b/src/PlaylistInfo.hxx
index fffafd819..e4cf0f4ef 100644
--- a/src/PlaylistInfo.hxx
+++ b/src/PlaylistInfo.hxx
@@ -22,6 +22,7 @@
#include "check.h"
#include "util/list.h"
+#include "gcc.h"
#include <string>
@@ -40,6 +41,18 @@ struct PlaylistInfo {
time_t mtime;
+ class CompareName {
+ const char *const name;
+
+ public:
+ constexpr CompareName(const char *_name):name(_name) {}
+
+ gcc_pure
+ bool operator()(const PlaylistInfo &pi) const {
+ return pi.name.compare(name) == 0;
+ }
+ };
+
template<typename N>
PlaylistInfo(N &&_name, time_t _mtime)
:name(std::forward<N>(_name)), mtime(_mtime) {}