source: ntrip/trunk/BNS/bnctime.h@ 4834

Last change on this file since 4834 was 2257, checked in by mervart, 15 years ago

* empty log message *

File size: 967 bytes
Line 
1
2#ifndef BNCTIME_H
3#define BNCTIME_H
4
5#include <string>
6
7class bncTime {
8 public:
9 bncTime() {this->reset();}
10 bncTime(int gpsw, double gpssec);
11
12 bncTime& set(int gpsw, double gpssec);
13 bncTime& set(int year, int month, int day, int hour, int min, double sec);
14 bncTime& set(int year, int month, int day, double daysec);
15
16 unsigned int mjd() const;
17 double daysec() const;
18 unsigned int gpsw() const;
19 double gpssec() const;
20 void civil_time (unsigned int& hour, unsigned int& min,
21 double& sec) const;
22
23 bool operator!=(const bncTime &time1) const;
24 double operator-(const bncTime &time1) const;
25 bncTime operator-(double sec) const;
26 bncTime operator+(double sec) const;
27
28 std::string timestr(unsigned numdec = 3, char sep = ':') const;
29
30 private:
31 bncTime& setmjd(double daysec, int mjd);
32 void reset() {_mjd = 0; _sec = 0;}
33
34 unsigned int _mjd;
35 double _sec;
36};
37
38#endif
39
Note: See TracBrowser for help on using the repository browser.