kodi
PVRTimerRuleMatcher.h
1 /*
2  * Copyright (C) 2012-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "XBDateTime.h"
12 
13 #include <memory>
14 
15 class CRegExp;
16 
17 namespace PVR
18 {
19 class CPVRChannel;
20 class CPVRTimerInfoTag;
21 class CPVREpgInfoTag;
22 
24 {
25 public:
26  CPVRTimerRuleMatcher(const std::shared_ptr<CPVRTimerInfoTag>& timerRule, const CDateTime& start);
27  virtual ~CPVRTimerRuleMatcher();
28 
29  std::shared_ptr<CPVRTimerInfoTag> GetTimerRule() const { return m_timerRule; }
30 
31  std::shared_ptr<const CPVRChannel> GetChannel() const;
32  CDateTime GetNextTimerStart() const;
33  bool Matches(const std::shared_ptr<const CPVREpgInfoTag>& epgTag) const;
34 
35 private:
36  bool MatchSeriesLink(const std::shared_ptr<const CPVREpgInfoTag>& epgTag) const;
37  bool MatchChannel(const std::shared_ptr<const CPVREpgInfoTag>& epgTag) const;
38  bool MatchStart(const std::shared_ptr<const CPVREpgInfoTag>& epgTag) const;
39  bool MatchEnd(const std::shared_ptr<const CPVREpgInfoTag>& epgTag) const;
40  bool MatchDayOfWeek(const std::shared_ptr<const CPVREpgInfoTag>& epgTag) const;
41  bool MatchSearchText(const std::shared_ptr<const CPVREpgInfoTag>& epgTag) const;
42 
43  const std::shared_ptr<CPVRTimerInfoTag> m_timerRule;
44  CDateTime m_start;
45  mutable std::unique_ptr<CRegExp> m_textSearch;
46 };
47 } // namespace PVR
Definition: ContextMenuManager.h:24
Definition: RegExp.h:27
DateTime class, which uses FileTime as it&#39;s base.
Definition: XBDateTime.h:63
Definition: PVRTimerRuleMatcher.h:23