00001
00002
00003
00004
00005
00006
00007
00008 #ifndef ROUTEPLANNINGV2_TIME_H_
00009 #define ROUTEPLANNINGV2_TIME_H_
00010 #include <string>
00011 #include <iostream>
00012 using std::string;
00013 using std::ostream;
00014 class Time
00015 {
00016 public:
00017 Time();
00018 Time(char hour, char minutes, char seconds);
00019 Time (const Time& originalTime);
00020 explicit Time(int secondsSinceDay);
00021
00022
00023 explicit Time(string GTFSTimeString);
00024
00025 bool operator< (const Time& otherTime) const;
00026 bool operator<= (const Time& otherTime) const;
00027 bool operator== (const Time& otherTime) const;
00028
00029 int minusInSeconds(const Time & otherTime) const;
00030
00031
00032
00033
00034
00035
00036 int minusInSecondsDependent(const Time & otherTime) const;
00037
00038
00039
00040 void setHour(char hour);
00041 void setMinute(char minute);
00042 void setSecond(char second);
00043 void setSecondsSinceDay(int secondsSinceDay);
00044 void addSeconds(int seconds);
00045 int hour() const;
00046
00047 int minute() const;
00048
00049 int second() const;
00050
00051 int secondsSinceDay() const;
00052 string toString() const;
00053 void printTime() const;
00054 string createJSON() const;
00055 private:
00056
00057
00058 int _secondsSinceDay;
00059 };
00060
00061 ostream& operator<< (ostream& outStream, const Time& time);
00062
00063 #endif // ROUTEPLANNINGV2_TIME_H_