| 1 |
/* |
| 2 |
* ShiftSelection.cpp - TaskJuggler |
| 3 |
* |
| 4 |
* SPDX-FileCopyrightText: 2001, 2002, 2003, 2004 Chris Schlaeger <[email protected]> |
| 5 |
* |
| 6 |
* This program is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of version 2 of the GNU General Public License as |
| 8 |
* published by the Free Software Foundation. |
| 9 |
* |
| 10 |
* $Id$ |
| 11 |
*/ |
| 12 |
|
| 13 |
// clazy:excludeall=qstring-arg |
| 14 |
#include "ShiftSelection.h" |
| 15 |
|
| 16 |
|
| 17 |
namespace TJ |
| 18 |
{ |
| 19 |
|
| 20 |
ShiftSelection::ShiftSelection(const ShiftSelection& sl) : |
| 21 |
period(new Interval(*sl.period)), |
| 22 |
shift(sl.shift) |
| 23 |
{ |
| 24 |
} |
| 25 |
|
| 26 |
bool |
| 27 |
ShiftSelection::isVacationDay(time_t day) const |
| 28 |
{ |
| 29 |
return period->contains(day) && shift->isVacationDay(day); |
| 30 |
} |
| 31 |
|
| 32 |
} // namespace TJ |
| 33 |
|
| 34 |
QDebug operator<<(QDebug dbg, const TJ::ShiftSelection &s) |
| 35 |
{ |
| 36 |
return dbg << &s; |
| 37 |
} |
| 38 |
QDebug operator<<(QDebug dbg, const TJ::ShiftSelection *s) |
| 39 |
{ |
| 40 |
dbg << "ShiftSelection["; |
| 41 |
if (s) dbg << s->getPeriod() << s->getShift(); |
| 42 |
else dbg << (void*)s; |
| 43 |
return dbg << ']'; |
| 44 |
} |