rllib  1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
rltime.h
Go to the documentation of this file.
1 /***************************************************************************
2  rltime.h - description
3  -------------------
4  begin : Tue Jan 02 2001
5  copyright : (C) 2001 by R. Lehrig
6  email : lehrig@t-online.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13  * published by the Free Software Foundation *
14  * *
15  ***************************************************************************/
16 #ifndef _RL_TIME_H_
17 #define _RL_TIME_H_
18 
19 #include "rldefine.h"
20 
24 class rlTime
25 {
26 public:
27  rlTime(int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0);
28  virtual ~rlTime();
29  const char *getTimeString();
30  const char *getIsoTimeString();
31  void getLocalTime();
32  int getFileModificationTime(const char *filename);
33 
37  void setTimeFromString(const char *time_string);
38  void setTimeFromIsoString(const char *iso_time_string);
39  void setLocalTime();
40  double secondsSinceEpoche();
41  rlTime& operator+= (rlTime &time);
42  rlTime& operator-= (rlTime &time);
43  rlTime operator+ (rlTime &time);
44  rlTime operator- (rlTime &time);
45  int operator== (rlTime &time);
46  int operator< (rlTime &time);
47  int operator<= (rlTime &time);
48  int operator> (rlTime &time);
49  int operator>= (rlTime &time);
50  int year;
51  int month;
52  int day;
53  int hour;
54  int minute;
55  int second;
57 private:
58  char time_string[32]; // 2001-11-23 12:52:60 0568
59 };
60 #endif