4 * Copyright (C) 2009 Andreas Waidler <arandes@programmers.at>
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #include <libdatetime/Time.hxx>
24 Time::Time(unsigned int seconds
)/*{{{*/
25 : _totalSeconds(seconds
)
30 _hours
= _seconds
/ (60 * 60);
31 _seconds
-= _hours
* 60 * 60;
33 _minutes
= _seconds
/ 60;
34 _seconds
-= _minutes
* 60;
38 unsigned int Time::hours() const/*{{{*/
44 unsigned int Time::minutes() const/*{{{*/
50 unsigned int Time::seconds() const/*{{{*/
56 Time::operator int() const/*{{{*/
62 Time
& Time::operator++()/*{{{*/
80 Time
Time::operator++(int noop
)/*{{{*/
89 Time
& Time::operator--()/*{{{*/
107 Time
Time::operator--(int noop
)/*{{{*/
118 // Use no tabs at all; two spaces indentation; max. eighty chars per line.
119 // vim: et ts=2 sw=2 sts=2 tw=80 fdm=marker