1 |
douglas |
21 |
// Zoe AIM Away Message RSS Feed Generator |
2 |
|
|
// |
3 |
|
|
// Seth King and Douglas Thrift |
4 |
|
|
// |
5 |
|
|
// $Id$ |
6 |
|
|
|
7 |
|
|
#ifndef _Stamp_hpp_ |
8 |
|
|
#define _Stamp_hpp_ |
9 |
|
|
|
10 |
|
|
#include "Zoe.hpp" |
11 |
|
|
|
12 |
|
|
#include <ctime> |
13 |
|
|
|
14 |
|
|
class Stamp |
15 |
|
|
{ |
16 |
|
|
private: |
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); |
22 |
|
|
Stamp(const ext::String& when); |
23 |
douglas |
25 |
operator ext::String() const; |
24 |
douglas |
21 |
Stamp operator+(Stamp stamp); |
25 |
|
|
Stamp operator-(Stamp stamp); |
26 |
|
|
Stamp& operator++() { *this += 1; return *this; } |
27 |
|
|
Stamp operator++(int) { Stamp stamp(*this); *this += 1; return stamp; } |
28 |
|
|
Stamp& operator+=(const Stamp& stamp) { *this = *this + stamp; return *this; |
29 |
|
|
} |
30 |
|
|
Stamp& operator--() { *this -= 1; return *this; } |
31 |
|
|
Stamp operator--(int) { Stamp stamp(*this); *this -= 1; return stamp; } |
32 |
|
|
Stamp& operator-=(const Stamp& stamp) { *this = *this - stamp; return *this; |
33 |
|
|
} |
34 |
|
|
}; |
35 |
|
|
|
36 |
|
|
#endif // _Stamp_hpp_ |