ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/zoe/trunk/Stamp.hpp
(Generate patch)

Comparing trunk/Stamp.hpp (file contents):
Revision 26 by douglas, 2004-07-17T16:29:02-07:00 vs.
Revision 27 by douglas, 2004-07-17T19:21:04-07:00

# Line 17 | Line 17 | 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);
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_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines