Whitespace and comment changes
This commit is contained in:
parent
b061c8082f
commit
f25a32c92c
1 changed files with 10 additions and 10 deletions
18
src/times.cc
18
src/times.cc
|
|
@ -50,7 +50,7 @@ namespace {
|
||||||
InputFacetType * input_facet;
|
InputFacetType * input_facet;
|
||||||
OutputFacetType * output_facet;
|
OutputFacetType * output_facet;
|
||||||
std::string temp_string;
|
std::string temp_string;
|
||||||
#endif
|
#endif // USE_BOOST_FACETS
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool has_year;
|
bool has_year;
|
||||||
|
|
@ -67,7 +67,7 @@ namespace {
|
||||||
output_facet = new OutputFacetType(fmt_str);
|
output_facet = new OutputFacetType(fmt_str);
|
||||||
output_stream.imbue(std::locale(std::locale::classic(), output_facet));
|
output_stream.imbue(std::locale(std::locale::classic(), output_facet));
|
||||||
}
|
}
|
||||||
#endif
|
#endif // USE_BOOST_FACETS
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_format(const char * fmt) {
|
void set_format(const char * fmt) {
|
||||||
|
|
@ -79,7 +79,7 @@ namespace {
|
||||||
input_facet->format(fmt_str);
|
input_facet->format(fmt_str);
|
||||||
else
|
else
|
||||||
output_facet->format(fmt_str);
|
output_facet->format(fmt_str);
|
||||||
#endif
|
#endif // USE_BOOST_FACETS
|
||||||
}
|
}
|
||||||
|
|
||||||
T parse(const char * str) {
|
T parse(const char * str) {
|
||||||
|
|
@ -92,12 +92,12 @@ namespace {
|
||||||
output_stream.clear();
|
output_stream.clear();
|
||||||
output_stream << when;
|
output_stream << when;
|
||||||
return output_stream.str();
|
return output_stream.str();
|
||||||
#else
|
#else // USE_BOOST_FACETS
|
||||||
std::tm data(to_tm(when));
|
std::tm data(to_tm(when));
|
||||||
char buf[128];
|
char buf[128];
|
||||||
std::strftime(buf, 127, fmt_str, &data);
|
std::strftime(buf, 127, fmt_str, &data);
|
||||||
return buf;
|
return buf;
|
||||||
#endif
|
#endif // USE_BOOST_FACETS
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -124,14 +124,14 @@ namespace {
|
||||||
input_stream.peek() != EOF)
|
input_stream.peek() != EOF)
|
||||||
return datetime_t();
|
return datetime_t();
|
||||||
return when;
|
return when;
|
||||||
#else
|
#else // USE_BOOST_FACETS
|
||||||
std::tm data;
|
std::tm data;
|
||||||
std::memset(&data, 0, sizeof(std::tm));
|
std::memset(&data, 0, sizeof(std::tm));
|
||||||
if (strptime(str, fmt_str, &data))
|
if (strptime(str, fmt_str, &data))
|
||||||
return posix_time::ptime_from_tm(data);
|
return posix_time::ptime_from_tm(data);
|
||||||
else
|
else
|
||||||
return datetime_t();
|
return datetime_t();
|
||||||
#endif
|
#endif // USE_BOOST_FACETS
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
|
@ -157,7 +157,7 @@ namespace {
|
||||||
input_stream.peek() != EOF)
|
input_stream.peek() != EOF)
|
||||||
return date_t();
|
return date_t();
|
||||||
return when;
|
return when;
|
||||||
#else
|
#else // USE_BOOST_FACETS
|
||||||
std::tm data;
|
std::tm data;
|
||||||
std::memset(&data, 0, sizeof(std::tm));
|
std::memset(&data, 0, sizeof(std::tm));
|
||||||
data.tm_mday = 1; // some formats have no day
|
data.tm_mday = 1; // some formats have no day
|
||||||
|
|
@ -165,7 +165,7 @@ namespace {
|
||||||
return gregorian::date_from_tm(data);
|
return gregorian::date_from_tm(data);
|
||||||
else
|
else
|
||||||
return date_t();
|
return date_t();
|
||||||
#endif
|
#endif // USE_BOOST_FACETS
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef temporal_io_t<datetime_t, posix_time::time_input_facet,
|
typedef temporal_io_t<datetime_t, posix_time::time_input_facet,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue