aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistInfo.hxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-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) {}