diff --git a/src/http.cc b/src/http.cc index 95e75dc..106e1ef 100644 --- a/src/http.cc +++ b/src/http.cc @@ -40,9 +40,9 @@ Json::Value taranis::HttpClient::get(const std::string &url) { try { if (not Json::parseFromStream(reader, input_stream, &root, &json_errors)) { BOOST_LOG_TRIVIAL(error) - << "JSON parser error " << json_errors << " " << url; + << "JSON parser error " << json_errors << " " << url; } - } catch (const Json::Exception& error) { + } catch (const Json::Exception &error) { BOOST_LOG_TRIVIAL(error) << error.what(); } return root; diff --git a/src/service.cc b/src/service.cc index 4bf83b4..b71c763 100644 --- a/src/service.cc +++ b/src/service.cc @@ -145,8 +145,10 @@ Condition Service::extract_condition(const Json::Value &value) { BOOST_LOG_TRIVIAL(debug) << "Extracting weather condition from JSON value"; const auto date = static_cast(value.get("dt", 0).asLargestInt()); - const auto sunrise = static_cast(value.get("sunrise", 0).asLargestInt()); - const auto sunset = static_cast(value.get("sunset", 0).asLargestInt()); + const auto sunrise = + static_cast(value.get("sunrise", 0).asLargestInt()); + const auto sunset = + static_cast(value.get("sunset", 0).asLargestInt()); const auto temperature = value.get("temp", NAN).asDouble(); const auto felt_temperature = value.get("feels_like", NAN).asDouble(); const auto pressure = value.get("pressure", 0).asInt(); @@ -204,10 +206,14 @@ DailyCondition Service::extract_daily_condition(const Json::Value &value) { BOOST_LOG_TRIVIAL(debug) << "Extracting daily condition from JSON value"; const auto date = static_cast(value.get("dt", 0).asLargestInt()); - const auto sunrise = static_cast(value.get("sunrise", 0).asLargestInt()); - const auto sunset = static_cast(value.get("sunset", 0).asLargestInt()); - const auto moonrise = static_cast(value.get("moonrise", 0).asLargestInt()); - const auto moonset = static_cast(value.get("moonset", 0).asLargestInt()); + const auto sunrise = + static_cast(value.get("sunrise", 0).asLargestInt()); + const auto sunset = + static_cast(value.get("sunset", 0).asLargestInt()); + const auto moonrise = + static_cast(value.get("moonrise", 0).asLargestInt()); + const auto moonset = + static_cast(value.get("moonset", 0).asLargestInt()); const auto moon_phase = value.get("moon_phase", NAN).asDouble(); const auto pressure = value.get("pressure", 0).asInt(); const auto humidity = value.get("humidity", 0).asInt(); @@ -269,11 +275,12 @@ std::vector Service::extract_alerts(const Json::Value &value) { std::vector alerts; for (auto &alert_value : value) { - const Alert alert{alert_value.get("sender_name", "").asString(), - alert_value.get("event", "").asString(), - static_cast(alert_value.get("start", 0).asLargestInt()), - static_cast(alert_value.get("end", 0).asLargestInt()), - alert_value.get("description", "").asString()}; + const Alert alert{ + alert_value.get("sender_name", "").asString(), + alert_value.get("event", "").asString(), + static_cast(alert_value.get("start", 0).asLargestInt()), + static_cast(alert_value.get("end", 0).asLargestInt()), + alert_value.get("description", "").asString()}; alerts.push_back(alert); } return alerts;