summaryrefslogtreecommitdiffstats
path: root/xbmc/pvr/timers/PVRTimerRuleMatcher.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/pvr/timers/PVRTimerRuleMatcher.h')
-rw-r--r--xbmc/pvr/timers/PVRTimerRuleMatcher.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/xbmc/pvr/timers/PVRTimerRuleMatcher.h b/xbmc/pvr/timers/PVRTimerRuleMatcher.h
new file mode 100644
index 0000000..9d502af
--- /dev/null
+++ b/xbmc/pvr/timers/PVRTimerRuleMatcher.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2012-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#include "XBDateTime.h"
+
+#include <memory>
+
+class CRegExp;
+
+namespace PVR
+{
+class CPVRChannel;
+class CPVRTimerInfoTag;
+class CPVREpgInfoTag;
+
+class CPVRTimerRuleMatcher
+{
+public:
+ CPVRTimerRuleMatcher(const std::shared_ptr<CPVRTimerInfoTag>& timerRule, const CDateTime& start);
+ virtual ~CPVRTimerRuleMatcher();
+
+ std::shared_ptr<CPVRTimerInfoTag> GetTimerRule() const { return m_timerRule; }
+
+ std::shared_ptr<CPVRChannel> GetChannel() const;
+ CDateTime GetNextTimerStart() const;
+ bool Matches(const std::shared_ptr<CPVREpgInfoTag>& epgTag) const;
+
+private:
+ bool MatchSeriesLink(const std::shared_ptr<CPVREpgInfoTag>& epgTag) const;
+ bool MatchChannel(const std::shared_ptr<CPVREpgInfoTag>& epgTag) const;
+ bool MatchStart(const std::shared_ptr<CPVREpgInfoTag>& epgTag) const;
+ bool MatchEnd(const std::shared_ptr<CPVREpgInfoTag>& epgTag) const;
+ bool MatchDayOfWeek(const std::shared_ptr<CPVREpgInfoTag>& epgTag) const;
+ bool MatchSearchText(const std::shared_ptr<CPVREpgInfoTag>& epgTag) const;
+
+ const std::shared_ptr<CPVRTimerInfoTag> m_timerRule;
+ CDateTime m_start;
+ mutable std::unique_ptr<CRegExp> m_textSearch;
+};
+} // namespace PVR