00001 /* 00002 * Copyright (C) 2003-2009 Olivier Boudeville 00003 * 00004 * This file is part of the Ceylan library. 00005 * 00006 * The Ceylan library is free software: you can redistribute it and/or modify 00007 * it under the terms of either the GNU Lesser General Public License or 00008 * the GNU General Public License, as they are published by the Free Software 00009 * Foundation, either version 3 of these Licenses, or (at your option) 00010 * any later version. 00011 * 00012 * The Ceylan library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License and the GNU General Public License 00016 * for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License and the GNU General Public License along with the Ceylan library. 00020 * If not, see <http://www.gnu.org/licenses/>. 00021 * 00022 * Author: Olivier Boudeville (olivier.boudeville@esperide.com) 00023 * 00024 */ 00025 00026 00027 #ifndef CEYLAN_TIME_STAMP_H_ 00028 #define CEYLAN_TIME_STAMP_H_ 00029 00030 00031 #include "CeylanTextDisplayable.h" // for inheritance 00032 #include "CeylanUtils.h" // for UtilsException 00033 #include "CeylanTypes.h" // for Ceylan::Sint16 etc. 00034 #include "CeylanSystem.h" // for Second 00035 00036 00037 #include <string> 00038 00039 00040 namespace Ceylan 00041 { 00042 00043 00044 00065 class CEYLAN_DLL Timestamp : public TextDisplayable 00066 { 00067 00068 00069 public: 00070 00071 00079 Timestamp() ; 00080 00081 00083 virtual ~Timestamp() throw() ; 00084 00085 00103 virtual const std::string toString( 00104 Ceylan::VerbosityLevels level = Ceylan::high ) const ; 00105 00106 00117 static std::string DescribeDuration( 00118 Ceylan::System::Second duration ) ; 00119 00120 00126 bool operator < ( Timestamp & second ) ; 00127 00128 00130 typedef Ceylan::Uint16 Year ; 00131 00132 00134 typedef Ceylan::Uint8 MonthOfTheYear ; 00135 00136 00138 typedef Ceylan::Uint8 DayOfTheMonth ; 00139 00140 00142 typedef Ceylan::Uint8 HourOfTheDay ; 00143 00144 00146 typedef Ceylan::Uint8 MinuteOfTheHour ; 00147 00148 00154 typedef Ceylan::Uint8 SecondOfTheMinute ; 00155 00156 00157 00158 protected: 00159 00160 00162 Year _year ; 00163 00165 MonthOfTheYear _month ; 00166 00168 DayOfTheMonth _day ; 00169 00171 HourOfTheDay _hour ; 00172 00174 MinuteOfTheHour _minute ; 00175 00177 SecondOfTheMinute _second ; 00178 00179 00180 00181 private: 00182 00183 00191 Timestamp( const Timestamp & source ) ; 00192 00193 00201 Timestamp & operator = ( const Timestamp & source ) ; 00202 00203 00204 } ; 00205 00206 00207 } 00208 00209 00210 #endif // CEYLAN_TIME_STAMP_H_ 00211