15 |
|
class Period |
16 |
|
{ |
17 |
|
private: |
18 |
< |
int seconds; |
18 |
> |
uint64_t seconds; |
19 |
|
public: |
20 |
< |
Period(int period) : seconds(period * Seconds) {} |
21 |
< |
operator int() const { return seconds; } |
20 |
> |
Period(uint64_t period) : seconds(period * Seconds) {} |
21 |
> |
operator uint64_t() const { return seconds; } |
22 |
|
}; |
23 |
|
|
24 |
|
typedef Period<60> Minute; |
35 |
|
&stamp); } |
36 |
|
Stamp(const ext::String& when); |
37 |
|
operator ext::String() const; |
38 |
< |
Stamp operator+(int seconds) const { return when + seconds; } |
39 |
< |
Stamp operator-(int seconds) const { return when - seconds; } |
40 |
< |
bool operator <(const Stamp& stamp) const { return when < stamp.when; } |
38 |
> |
Stamp operator+(std::time_t seconds) const { return when + seconds; } |
39 |
> |
Stamp operator-(std::time_t seconds) const { return when - seconds; } |
40 |
> |
bool operator<(const Stamp& stamp) const { return when < stamp.when; } |
41 |
|
}; |
42 |
|
|
43 |
< |
inline ext::String operator+(const Stamp& stamp, const ext::String& string) |
44 |
< |
{ |
45 |
< |
return ext::String(stamp) + string; |
46 |
< |
} |
47 |
< |
|
48 |
< |
inline ext::String operator+(const ext::String& string, const Stamp& stamp) |
49 |
< |
{ |
50 |
< |
return string + ext::String(stamp); |
51 |
< |
} |
52 |
< |
|
53 |
< |
inline std::ostream& operator<<(std::ostream& sout, const Stamp& stamp) |
54 |
< |
{ |
55 |
< |
return sout << ext::String(stamp); |
56 |
< |
} |
43 |
> |
inline std::ostream& operator<<(std::ostream& sout, const Stamp& stamp) { return sout << ext::String(stamp); } |
44 |
|
|
45 |
|
#endif // _Stamp_hpp_ |