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 32 by douglas, 2004-07-20T00:40:43-07:00 vs.
Revision 37 by douglas, 2004-07-22T16:00:52-07:00

# Line 15 | Line 15 | template<int Seconds>
15   class Period
16   {
17   private:
18 <        int seconds;
18 >        std::time_t seconds;
19   public:
20 <        Period(int period) : seconds(period * Seconds) {}
21 <        operator int() const { return seconds; }
20 >        Period(std::time_t period) : seconds(period * Seconds) {}
21 >        operator std::time_t() const { return seconds; }
22   };
23  
24   typedef Period<60> Minute;
# Line 34 | Line 34 | public:
34          Stamp(std::time_t when = std::time(NULL)) : when(when) { gmtime_r(&when,
35                  &stamp); }
36          Stamp(const ext::String& when);
37 +        ext::String get822() const;
38 +        ext::String getW3() const;
39 +        void setSeconds(int seconds);
40 +        void setMinutes(int minutes);
41          operator ext::String() const;
42 <        Stamp operator+(int seconds) const { return when + seconds; }
43 <        Stamp operator-(int seconds) const { return when - seconds; }
44 <        bool operator <(const Stamp& stamp) const { return when < stamp.when; }
42 >        Stamp operator+(std::time_t seconds) const { return when + seconds; }
43 >        Stamp operator-(std::time_t seconds) const { return when - seconds; }
44 >        bool operator<(const Stamp& stamp) const { return when < stamp.when; }
45   };
46  
43 inline ext::String operator+(const Stamp& stamp, const ext::String& string)
44 {
45        return ext::String(stamp) + string;
46 }
47
48 inline ext::String operator+(const ext::String& string, const Stamp& stamp)
49 {
50        return string + ext::String(stamp);
51 }
52
47   inline std::ostream& operator<<(std::ostream& sout, const Stamp& stamp)
48   {
49          return sout << ext::String(stamp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines