@@ -98,7 +98,7 @@ constexpr auto kDate = "date";
98
98
99
99
#ifdef _WIN32
100
100
// Windows does not have ::strptime and ::timegm
101
- std::time_t doParseTime (const std::string& value) {
101
+ std::time_t DoParseTime (const std::string& value) {
102
102
std::tm tm = {};
103
103
std::istringstream ss (value);
104
104
ss >> std::get_time (&tm , " %a, %d %b %Y %H:%M:%S %z" );
@@ -107,27 +107,26 @@ std::time_t doParseTime(const std::string& value) {
107
107
108
108
#else
109
109
110
- std::time_t doParseTime (const std::string& value) {
110
+ std::time_t DoParseTime (const std::string& value) {
111
111
std::tm tm = {};
112
- std::istringstream ss (value);
113
112
const auto format = " %a, %d %b %Y %H:%M:%S %Z" ;
114
- const auto parsedUntil = ::strptime (value.c_str (), format, &tm );
115
- if (parsedUntil != value.c_str () + value.size ()) {
113
+ const auto parsed_until = ::strptime (value.c_str (), format, &tm );
114
+ if (parsed_until != value.c_str () + value.size ()) {
116
115
OLP_SDK_LOG_WARNING (kLogTag , " Timestamp is not fully parsed" << value);
117
116
}
118
117
return timegm (&tm );
119
118
}
120
119
121
120
#endif
122
121
123
- std::time_t gmtEpochOffset () {
124
- const auto epochAsDateTime = " Thu, 1 Jan 1970 0:00:00 GMT" ;
125
- return doParseTime (epochAsDateTime );
122
+ std::time_t GmtEpochOffset () {
123
+ const auto epoch_as_date_time = " Thu, 1 Jan 1970 0:00:00 GMT" ;
124
+ return DoParseTime (epoch_as_date_time );
126
125
}
127
126
128
127
std::time_t ParseTime (const std::string& value) {
129
- const auto time = doParseTime (value);
130
- const auto offset = gmtEpochOffset ();
128
+ const auto time = DoParseTime (value);
129
+ const auto offset = GmtEpochOffset ();
131
130
return time - offset;
132
131
}
133
132
0 commit comments