17 |
|
std::tm stamp; |
18 |
|
public: |
19 |
|
Stamp(std::time_t now = std::time(NULL)) { gmtime_r(&now, &stamp); } |
20 |
– |
Stamp(int day, int month = 0, int year = 0, int hour = 0, int minute = 0, |
21 |
– |
int second = 0); |
20 |
|
Stamp(const ext::String& when); |
21 |
|
operator ext::String() const; |
22 |
< |
Stamp operator+(Stamp stamp); |
23 |
< |
Stamp operator-(Stamp stamp); |
22 |
> |
Stamp operator+(int days) const; |
23 |
> |
Stamp operator-(int days) const { return *this + -days; } |
24 |
|
Stamp& operator++() { *this += 1; return *this; } |
25 |
|
Stamp operator++(int) { Stamp stamp(*this); *this += 1; return stamp; } |
26 |
< |
Stamp& operator+=(const Stamp& stamp) { *this = *this + stamp; return *this; |
29 |
< |
} |
26 |
> |
Stamp& operator+=(int days) { *this = *this + days; return *this; } |
27 |
|
Stamp& operator--() { *this -= 1; return *this; } |
28 |
|
Stamp operator--(int) { Stamp stamp(*this); *this -= 1; return stamp; } |
29 |
< |
Stamp& operator-=(const Stamp& stamp) { *this = *this - stamp; return *this; |
33 |
< |
} |
29 |
> |
Stamp& operator-=(int days) { *this = *this - days; return *this; } |
30 |
|
}; |
31 |
|
|
32 |
|
#endif // _Stamp_hpp_ |