ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/zoe/trunk/Stamp.hpp
Revision: 27
Committed: 2004-07-17T19:21:04-07:00 (20 years, 11 months ago) by douglas
File size: 855 byte(s)
Log Message:
Feed me!

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(const ext::String& when);
21 douglas 25 operator ext::String() const;
22 douglas 27 Stamp operator+(int days) const;
23     Stamp operator-(int days) const { return *this + -days; }
24 douglas 21 Stamp& operator++() { *this += 1; return *this; }
25     Stamp operator++(int) { Stamp stamp(*this); *this += 1; return stamp; }
26 douglas 27 Stamp& operator+=(int days) { *this = *this + days; return *this; }
27 douglas 21 Stamp& operator--() { *this -= 1; return *this; }
28     Stamp operator--(int) { Stamp stamp(*this); *this -= 1; return stamp; }
29 douglas 27 Stamp& operator-=(int days) { *this = *this - days; return *this; }
30 douglas 21 };
31    
32     #endif // _Stamp_hpp_

Properties

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