rllib  1
rltime_v1.h
Go to the documentation of this file.
1 
2 /***************************************************************************
3  rltime.h - description
4  -------------------
5  begin : Tue Jan 02 2001
6  copyright : (C) 2001 by R. Lehrig
7  email : lehrig@t-online.de
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This library is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
14  * published by the Free Software Foundation *
15  * *
16  ***************************************************************************/
17 #ifndef _RL_TIME_V1_H_
18 #define _RL_TIME_V1_H_
19 
20 #include "rldefine.h"
21 
22 namespace ns_rltime_v1
23 {
24 
28 class rlTime
29 {
30 public:
31  rlTime(int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0);
32  virtual ~rlTime();
33  const char *version();
34  const char *getTimeString();
35  const char *getIsoTimeString();
36  void getLocalTime();
37  int getFileModificationTime(const char *filename);
38 
42  void setTimeFromString(const char *time_string);
43  void setTimeFromIsoString(const char *iso_time_string);
44  void setLocalTime();
45  double secondsSinceEpoche();
46  rlTime& operator+= (rlTime &time);
47  rlTime& operator-= (rlTime &time);
48  rlTime operator+ (rlTime &time);
49  rlTime operator- (rlTime &time);
50  int operator== (rlTime &time);
51  int operator< (rlTime &time);
52  int operator<= (rlTime &time);
53  int operator> (rlTime &time);
54  int operator>= (rlTime &time);
55  int year;
56  int month;
57  int day;
58  int hour;
59  int minute;
60  int second;
62 private:
63  char time_string[32]; // 2001-11-23 12:52:60 056
64  char iso_time_string[32]; // 2001-11-23T12:52:60.056
65 };
66 
67 } // end of namespace ns_rltime_v1
68 
69 #endif
int operator>(rlTime &time)
Definition: rltime.cpp:495
rlTime(int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0)
Definition: rltime_v1.cpp:65
char iso_time_string[32]
Definition: rltime_v1.h:64
const char * getIsoTimeString()
Definition: rltime_v1.cpp:115
double secondsSinceEpoche()
Definition: rltime.cpp:527
rlTime operator-(rlTime &time)
Definition: rltime.cpp:355
int operator>=(rlTime &time)
Definition: rltime.cpp:520
rlTime & operator-=(rlTime &time)
Definition: rltime_v1.cpp:276
const char * version()
Definition: rltime_v1.cpp:80
void setTimeFromString(const char *time_string)
Definition: rltime_v1.cpp:85
const char * getTimeString()
Definition: rltime_v1.cpp:109
void setTimeFromIsoString(const char *iso_time_string)
Definition: rltime_v1.cpp:97
int operator<(rlTime &time)
Definition: rltime.cpp:463
int operator==(rlTime &time)
Definition: rltime.cpp:450
int operator<=(rlTime &time)
Definition: rltime.cpp:488
rlTime operator+(rlTime &time)
Definition: rltime.cpp:277
int getFileModificationTime(const char *filename)
Definition: rltime_v1.cpp:171
rlTime & operator+=(rlTime &time)
Definition: rltime_v1.cpp:268
char time_string[32]
Definition: rltime_v1.h:63