lldate.h

Go to the documentation of this file.
00001 
00034 #ifndef LL_LLDATE_H
00035 #define LL_LLDATE_H
00036 
00037 #include <iosfwd>
00038 
00039 #include "stdtypes.h"
00040 
00047 class LLDate
00048 {
00049 public:
00053         LLDate();
00054 
00058         LLDate(const LLDate& date);
00059 
00065         LLDate(F64 seconds_since_epoch);
00066 
00075         LLDate(const std::string& iso8601_date);
00076 
00082         std::string asString() const;
00083         std::string asRFC1123() const;
00084         void toStream(std::ostream&) const;
00085         void toHTTPDateStream(std::ostream&) const;
00098         bool fromString(const std::string& iso8601_date);
00099         bool fromStream(std::istream&);
00100 
00106         F64 secondsSinceEpoch() const;
00107 
00113         void secondsSinceEpoch(F64 seconds);
00114 
00115 private:
00116         F64 mSecondsSinceEpoch;
00117 };
00118 
00119 
00120 // Helper function to stream out a date
00121 std::ostream& operator<<(std::ostream& s, const LLDate& date);
00122 
00123 // Helper function to stream in a date
00124 std::istream& operator>>(std::istream& s, LLDate& date);
00125 
00126 
00127 const static std::string weekdays[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
00128 
00129 const static std::string months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
00130 
00131 #endif // LL_LLDATE_H

Generated on Thu Jul 1 06:08:24 2010 for Second Life Viewer by  doxygen 1.4.7