2 #ifndef GAUDIKERNEL_TIME_H
3 #define GAUDIKERNEL_TIME_H 1
25 const std::string& Tag =
"*Gaudi::Time*",
34 typedef struct _FILETIME FILETIME;
66 TimeSpan (
int days,
int hours,
int mins,
int secs,
int nsecs);
68 int days (
void)
const;
69 int hours (
void)
const;
70 int minutes (
void)
const;
73 int lastHours (
void)
const;
74 int lastMinutes (
void)
const;
75 int lastSeconds (
void)
const;
76 int lastNSeconds (
void)
const;
236 static const int SECS_PER_DAY = 86400;
239 static const int SECS_PER_HOUR = 3600;
248 Time (
int year,
int month,
int day,
int hour,
int min,
int sec,
255 static Time epoch (
void);
257 static Time max (
void);
259 static Time current (
void);
261 static Time from (
const FILETIME *systime);
265 tm split (
bool local,
int *nsecpart = 0)
const;
266 tm utc (
int *nsecpart = 0)
const;
267 tm local (
int *nsecpart = 0)
const;
269 int year (
bool local)
const;
270 int month (
bool local)
const;
271 int day (
bool local)
const;
272 int hour (
bool local)
const;
273 int minute (
bool local)
const;
274 int second (
bool local)
const;
275 int nsecond (
void)
const;
276 int weekday (
bool local)
const;
277 bool isdst (
bool local)
const;
279 ValueType utcoffset (
int *daylight = 0)
const;
280 const char * timezone (
int *daylight = 0)
const;
287 std::string
format (
bool local, std::string spec =
"%c")
const;
288 std::string nanoformat (
size_t minwidth = 1,
size_t maxwidth = 9)
const;
290 static bool isLeap (
int year);
293 static unsigned toDosDate (
Time time);
294 static Time fromDosDate (
unsigned dosDate);
299 inline void TimeAssert(
bool cond,
const std::string &
msg =
"time assertion failed")
const {
309 #endif // GAUDIKERNEL_TIME_H
Define general base for Gaudi exception.
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
virtual ~TimeException()
Destructor needed to match the signature of GaudiException::~GaudiException().
void TimeAssert(bool cond, const std::string &msg="time assertion failed") const
Months
Symbolic names for months.
TimeException(const std::string &Message="unspecified exception", const std::string &Tag="*Gaudi::Time*", const StatusCode &Code=StatusCode::FAILURE)
This class is used for returning status codes from appropriate routines.
Exception thrown by Gaudi::Time.
This is a number of static methods for bootstrapping the Gaudi framework.