rllib  1
rltime.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 
25 class rlTime
26 {
27 public:
28  rlTime(int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0);
29  virtual ~rlTime();
30  const char *version();
31  const char *getTimeString();
32  const char *getIsoTimeString();
33  const char *toString(const char *format);
34  void getLocalTime();
35  int getFileModificationTime(const char *filename);
36 
40  void setTimeFromString(const char *time_string);
41  void setTimeFromIsoString(const char *iso_time_string);
42  void setLocalTime();
43  double secondsSinceEpoche();
44  rlTime& operator+= (rlTime &time);
45  rlTime& operator-= (rlTime &time);
46  rlTime operator+ (rlTime &time);
47  rlTime operator- (rlTime &time);
48  int operator== (rlTime &time);
49  int operator< (rlTime &time);
50  int operator<= (rlTime &time);
51  int operator> (rlTime &time);
52  int operator>= (rlTime &time);
53  int year;
54  int month;
55  int day;
56  int hour;
57  int minute;
58  int second;
60 private:
61  char time_string[32]; // 2001-11-23 12:52:60 056
62  char iso_time_string[32]; // 2001-11-23T12:52:60.056
63 };
64 
65 #endif
const char * getTimeString()
Definition: rltime.cpp:106
void getLocalTime()
Definition: rltime.cpp:342
int year
Definition: rltime.h:53
virtual ~rlTime()
Definition: rltime.cpp:73
int hour
Definition: rltime.h:56
char iso_time_string[32]
Definition: rltime.h:62
int operator>=(rlTime &time)
Definition: rltime.cpp:750
rlTime & operator-=(rlTime &time)
Definition: rltime.cpp:497
int month
Definition: rltime.h:54
const char * toString(const char *format)
Definition: rltime.cpp:156
void setTimeFromIsoString(const char *iso_time_string)
Definition: rltime.cpp:94
const char * getIsoTimeString()
Definition: rltime.cpp:112
int operator==(rlTime &time)
Definition: rltime.cpp:680
void setLocalTime()
Definition: rltime.cpp:419
int operator<=(rlTime &time)
Definition: rltime.cpp:718
int day
Definition: rltime.h:55
rlTime operator-(rlTime &time)
Definition: rltime.cpp:583
const char * version()
Definition: rltime.cpp:77
int second
Definition: rltime.h:58
rlTime & operator+=(rlTime &time)
Definition: rltime.cpp:489
int millisecond
Definition: rltime.h:59
int minute
Definition: rltime.h:57
rlTime operator+(rlTime &time)
Definition: rltime.cpp:505
int getFileModificationTime(const char *filename)
Definition: rltime.cpp:392
double secondsSinceEpoche()
Definition: rltime.cpp:757
char time_string[32]
Definition: rltime.h:61
rlTime(int Year=0, int Month=0, int Day=0, int Hour=0, int Minute=0, int Second=0, int Millisecond=0)
Definition: rltime.cpp:62
Definition: rltime.h:25
int operator>(rlTime &time)
Definition: rltime.cpp:725
void setTimeFromString(const char *time_string)
Definition: rltime.cpp:82
int operator<(rlTime &time)
Definition: rltime.cpp:693