Check if r1 is more general range and includes r2.
| 372 | |
| 373 | /// Check if r1 is more general range and includes r2. |
| 374 | bool IsR1IncludesR2(RuleSequence const & r1, RuleSequence const & r2) |
| 375 | { |
| 376 | /// @todo Very naive implementation, but ok in most cases. |
| 377 | if ((r1.GetYears().empty() && !r2.GetYears().empty()) || |
| 378 | (r1.GetMonths().empty() && !r2.GetMonths().empty()) || |
| 379 | (r1.GetWeeks().empty() && !r2.GetWeeks().empty()) || |
| 380 | (r1.GetWeekdays().IsEmpty() && !r2.GetWeekdays().IsEmpty())) |
| 381 | { |
| 382 | return true; |
| 383 | } |
| 384 | return false; |
| 385 | } |
| 386 | |
| 387 | bool IsActive(RuleSequence const & rule, time_t const timestamp) |
| 388 | { |