ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/zoe/trunk/Stamp.hpp
Revision: 25
Committed: 2004-07-17T16:29:02-07:00 (20 years, 11 months ago) by douglas
File size: 942 byte(s)
Log Message:
RSS 2.0, baby!

File Contents

# User Rev Content
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_

Properties

Name Value
svn:eol-style native
svn:keywords Id