15# pragma warning (disable: 4996)
58 bool greg = gregorian(y,
m,
d);
59 y += (
m + 9) / 12 - 1;
67 + (
greg ? (y / 100) / 4 - (y / 100) + 2 : 0)
80 if (!(s > 0 && y ==
y1 &&
m ==
m1 &&
d == d1))
85 " before 0001-01-01"));
91 bool greg = gregorian(s);
97 c = (4 * s + 3) / 146097;
98 s -= (c * 146097) / 4;
100 y = (4 * s + 3) / 1461;
103 m = (5 * s + 2) / 153;
104 s -= (153 *
m + 2) / 5;
107 m = (
m + 2) % 12 + 1;
114 y =
now->tm_year + 1900;
119 int y1,
m1 = 1, d1 = 1;
120 const char* digits =
"0123456789";
121 string::size_type
p1 = s.find_first_not_of(digits);
122 if (
p1 == string::npos)
124 else if (s[
p1] !=
'-')
130 if (++
p1 == s.size())
132 string::size_type
p2 = s.find_first_not_of(digits,
p1);
133 if (
p2 == string::npos)
135 else if (s[
p2] !=
'-')
141 if (++
p2 == s.size())
161 string::size_type
r = s.find(
char(
toupper(c)));
162 return r == string::npos ? -1 :
int(
r);
171 std::string& key, std::string& value,
172 char equals,
char comment) {
176 if (
linea.empty())
return false;
179 if (
key.empty())
return false;
185#if GEOGRAPHICLIB_PRECISION == 5
Header for GeographicLib::Utility class.
Exception handling for GeographicLib.
static int set_digits(int ndigits)
static void date(int s, int &y, int &m, int &d)
static int lookup(const std::string &s, char c)
static bool ParseLine(const std::string &line, std::string &key, std::string &value, char equals='\0', char comment='#')
static T val(const std::string &s)
static int set_digits(int ndigits=0)
static std::string trim(const std::string &s)
static int day(int y, int m=1, int d=1)
static std::string str(T x, int p=-1)
Namespace for GeographicLib.