mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -58,9 +58,7 @@ namespace google
|
||||
// static
|
||||
std::string const GoogleApi::kApiName = "google";
|
||||
|
||||
GoogleApi::GoogleApi(std::string const & token)
|
||||
: RoutingApi(kApiName, token, kMaxRPS)
|
||||
{}
|
||||
GoogleApi::GoogleApi(std::string const & token) : RoutingApi(kApiName, token, kMaxRPS) {}
|
||||
|
||||
Response GoogleApi::CalculateRoute(Params const & params, int32_t startTimeZoneUTC) const
|
||||
{
|
||||
@@ -80,7 +78,7 @@ Response GoogleApi::CalculateRoute(Params const & params, int32_t startTimeZoneU
|
||||
|
||||
auto const startLatLon = leg.m_steps.front().m_startLocation;
|
||||
apiRoute.m_waypoints.emplace_back(startLatLon.m_lat, startLatLon.m_lon);
|
||||
for (const auto & step : leg.m_steps)
|
||||
for (auto const & step : leg.m_steps)
|
||||
{
|
||||
auto const & prev = step.m_startLocation;
|
||||
auto const & next = step.m_endLocation;
|
||||
@@ -135,11 +133,9 @@ std::string GoogleApi::GetDirectionsURL(Params const & params, int32_t startTime
|
||||
LOG(LDEBUG, ("&departure_time =", secondFromEpoch));
|
||||
|
||||
std::stringstream ss;
|
||||
ss << kBaseUrl
|
||||
<< "&origin=" << std::to_string(start.m_lat) << "," << std::to_string(start.m_lon)
|
||||
ss << kBaseUrl << "&origin=" << std::to_string(start.m_lat) << "," << std::to_string(start.m_lon)
|
||||
<< "&destination=" << std::to_string(finish.m_lat) << "," << std::to_string(finish.m_lon)
|
||||
<< "&key=" << GetAccessToken()
|
||||
<< "&alternatives=true"
|
||||
<< "&key=" << GetAccessToken() << "&alternatives=true"
|
||||
<< "&departure_time=" << secondFromEpoch;
|
||||
|
||||
return ss.str();
|
||||
|
||||
@@ -32,6 +32,6 @@ private:
|
||||
GoogleResponse MakeRequest(Params const & params, int32_t startTimeZoneUTC) const;
|
||||
std::string GetDirectionsURL(Params const & params, int32_t startTimeZoneUTC) const;
|
||||
};
|
||||
} // namespace mapbox
|
||||
} // namespace google
|
||||
} // namespace api
|
||||
} // namespace routing_quality
|
||||
|
||||
@@ -27,6 +27,6 @@ std::string DebugPrint(LatLon const & latlon)
|
||||
ss << "google::LatLon(" << latlon.m_lat << ", " << latlon.m_lon << ")";
|
||||
return ss.str();
|
||||
}
|
||||
} // namespace mapbox
|
||||
} // namespace google
|
||||
} // namespace api
|
||||
} // namespace routing_quality
|
||||
|
||||
@@ -15,8 +15,7 @@ namespace google
|
||||
{
|
||||
struct LatLon
|
||||
{
|
||||
DECLARE_VISITOR(visitor(m_lat, "lat"),
|
||||
visitor(m_lon, "lng"))
|
||||
DECLARE_VISITOR(visitor(m_lat, "lat"), visitor(m_lon, "lng"))
|
||||
|
||||
bool operator==(LatLon const & rhs) const;
|
||||
|
||||
@@ -26,8 +25,7 @@ struct LatLon
|
||||
|
||||
struct Step
|
||||
{
|
||||
DECLARE_VISITOR(visitor(m_startLocation, "start_location"),
|
||||
visitor(m_endLocation, "end_location"))
|
||||
DECLARE_VISITOR(visitor(m_startLocation, "start_location"), visitor(m_endLocation, "end_location"))
|
||||
|
||||
bool operator==(Step const & rhs) const;
|
||||
|
||||
@@ -51,9 +49,7 @@ struct Distance
|
||||
|
||||
struct Leg
|
||||
{
|
||||
DECLARE_VISITOR(visitor(m_distance, "distance"),
|
||||
visitor(m_duration, "duration"),
|
||||
visitor(m_steps, "steps"))
|
||||
DECLARE_VISITOR(visitor(m_distance, "distance"), visitor(m_duration, "duration"), visitor(m_steps, "steps"))
|
||||
|
||||
Distance m_distance;
|
||||
Duration m_duration;
|
||||
@@ -76,6 +72,6 @@ struct GoogleResponse
|
||||
};
|
||||
|
||||
std::string DebugPrint(LatLon const & latlon);
|
||||
} // namespace mapbox
|
||||
} // namespace google
|
||||
} // namespace api
|
||||
} // namespace routing_quality
|
||||
|
||||
Reference in New Issue
Block a user