39 p_tm.tm_mday = strtol(s, &nds, 10);
42 Oks::error_msg(
"oks::Time::Time()") <<
"failed to find the day in \'" << s2 <<
"\'\n";
48 if(
p_tm.tm_mday > 31 ||
p_tm.tm_mday == 0) {
49 Oks::error_msg(
"oks::Time::Time()") <<
"bad day " <<
p_tm.tm_mday <<
" in \'" << s2 <<
"\'\n";
56 p_tm.tm_mon = strtol(s, &nds, 10);
59 Oks::error_msg(
"oks::Time::Time()") <<
"failed to find the month in \'" << s2 <<
"\'\n";
65 if(
p_tm.tm_mon > 12 ||
p_tm.tm_mon == 0) {
66 Oks::error_msg(
"oks::Time::Time()") <<
"bad month " <<
p_tm.tm_mon <<
" in \'" << s2 <<
"\'\n";
75 p_tm.tm_year = strtol(s, &nds, 10);
77 if(
p_tm.tm_year >= 0) {
78 if(
p_tm.tm_year < 70)
p_tm.tm_year += 2000;
79 else if(
p_tm.tm_year < 100)
p_tm.tm_year += 1900;
97 p_tm.tm_hour = strtol(s, &nds, 10);
100 Oks::error_msg(
"oks::Time::Time()") <<
"failed to find the hour in \'" << s2 <<
"\'\n";
106 if(
p_tm.tm_hour > 23) {
107 Oks::error_msg(
"oks::Time::Time()") <<
"bad hour " <<
p_tm.tm_hour <<
" in \'" << s2 <<
"\'\n";
114 p_tm.tm_min = strtol(s, &nds, 10);
116 if(
p_tm.tm_min > 59) {
117 Oks::error_msg(
"oks::Time::Time()") <<
"bad minute " <<
p_tm.tm_min <<
" in \'" << s2 <<
"\'\n";
121 if(*nds !=
':')
return;
126 p_tm.tm_sec = strtol(nds + 1, &nds, 10);
128 if(
p_tm.tm_sec > 59) {
129 Oks::error_msg(
"oks::Time::Time()") <<
"bad second " <<
p_tm.tm_sec <<
" in \'" << s2 <<
"\'\n";
191 if(p_idx == std::string::npos)
return s_empty;
192 std::string::size_type end_idx = p_string.find_first_of(p_delimeters, p_idx);
193 if(end_idx == std::string::npos) end_idx=p_string.length();
194 std::string token = p_string.substr(p_idx, end_idx - p_idx);
195 p_idx = p_string.find_first_not_of(p_delimeters, end_idx);
202 if(p_idx == std::string::npos) {
207 std::string::size_type end_idx = p_string.find_first_of(p_delimeters, p_idx);
208 if(end_idx == std::string::npos) end_idx=p_string.length();
209 token.assign(p_string, p_idx, end_idx - p_idx);
210 p_idx = p_string.find_first_not_of(p_delimeters, end_idx);