mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +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:
@@ -21,9 +21,7 @@ double constexpr kEps = 1e-10;
|
||||
// maximal zoom levels.
|
||||
double constexpr kMaxZoom = 20.0;
|
||||
|
||||
bool MatchLatLonZoom(string const & s, regex const & re,
|
||||
size_t lati, size_t loni, size_t zoomi,
|
||||
GeoURLInfo & info)
|
||||
bool MatchLatLonZoom(string const & s, regex const & re, size_t lati, size_t loni, size_t zoomi, GeoURLInfo & info)
|
||||
{
|
||||
std::smatch m;
|
||||
if (!std::regex_search(s, m, re) || m.size() != 4)
|
||||
@@ -55,13 +53,9 @@ std::string const kIntScale = R"((\d+))";
|
||||
// 2gis can accept float or int coordinates and scale.
|
||||
std::string const kFloatIntCoord = R"(([+-]?\d+\.?\d*))";
|
||||
std::string const kFloatIntScale = R"((\d+\.?\d*))";
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
LatLonParser::LatLonParser()
|
||||
: m_info(nullptr)
|
||||
, m_regexp(kFloatCoord + ", *" + kFloatCoord)
|
||||
{
|
||||
}
|
||||
LatLonParser::LatLonParser() : m_info(nullptr), m_regexp(kFloatCoord + ", *" + kFloatCoord) {}
|
||||
|
||||
void LatLonParser::Reset(url::Url const & url, GeoURLInfo & info)
|
||||
{
|
||||
@@ -154,10 +148,7 @@ int LatLonParser::GetCoordinatesPriority(string const & token)
|
||||
|
||||
std::string const kLatLon = R"(([+-]?\d+(?:\.\d+)?), *([+-]?\d+(?:\.\d+)?)(:?, *([+-]?\d+(?:\.\d+)?))?)";
|
||||
|
||||
GeoParser::GeoParser()
|
||||
: m_latlonRe(kLatLon), m_zoomRe(kFloatIntScale)
|
||||
{
|
||||
}
|
||||
GeoParser::GeoParser() : m_latlonRe(kLatLon), m_zoomRe(kFloatIntScale) {}
|
||||
|
||||
bool GeoParser::Parse(std::string const & raw, GeoURLInfo & info) const
|
||||
{
|
||||
@@ -265,7 +256,7 @@ bool GeoParser::Parse(std::string const & raw, GeoURLInfo & info) const
|
||||
}
|
||||
// Ignore special 0,0 lat,lon if q= presents.
|
||||
if (!info.m_query.empty() && fabs(info.m_lat) < kEps && fabs(info.m_lon) < kEps)
|
||||
info.m_lat = info.m_lon = ms::LatLon::kInvalid;
|
||||
info.m_lat = info.m_lon = ms::LatLon::kInvalid;
|
||||
}
|
||||
|
||||
if (!info.IsLatLonValid() && info.m_query.empty())
|
||||
@@ -297,10 +288,9 @@ bool GeoParser::Parse(std::string const & raw, GeoURLInfo & info) const
|
||||
}
|
||||
|
||||
DoubleGISParser::DoubleGISParser()
|
||||
: m_pathRe("/" + kFloatIntCoord + "," + kFloatIntCoord + "/zoom/" + kFloatIntScale)
|
||||
, m_paramRe(kFloatIntCoord + "," + kFloatIntCoord + "/" + kFloatIntScale)
|
||||
{
|
||||
}
|
||||
: m_pathRe("/" + kFloatIntCoord + "," + kFloatIntCoord + "/zoom/" + kFloatIntScale)
|
||||
, m_paramRe(kFloatIntCoord + "," + kFloatIntCoord + "/" + kFloatIntScale)
|
||||
{}
|
||||
|
||||
bool DoubleGISParser::Parse(url::Url const & url, GeoURLInfo & info) const
|
||||
{
|
||||
@@ -315,10 +305,7 @@ bool DoubleGISParser::Parse(url::Url const & url, GeoURLInfo & info) const
|
||||
return MatchLatLonZoom(url.GetHostAndPath(), m_pathRe, 2, 1, 3, info);
|
||||
}
|
||||
|
||||
OpenStreetMapParser::OpenStreetMapParser()
|
||||
: m_regex(kIntScale + "/" + kFloatCoord + "/" + kFloatCoord)
|
||||
{
|
||||
}
|
||||
OpenStreetMapParser::OpenStreetMapParser() : m_regex(kIntScale + "/" + kFloatCoord + "/" + kFloatCoord) {}
|
||||
|
||||
bool OpenStreetMapParser::Parse(url::Url const & url, GeoURLInfo & info) const
|
||||
{
|
||||
@@ -401,4 +388,4 @@ bool UnifiedParser::Parse(std::string const & raw, GeoURLInfo & res)
|
||||
return m_llParser.IsValid();
|
||||
}
|
||||
|
||||
} // namespace geo
|
||||
} // namespace geo
|
||||
|
||||
Reference in New Issue
Block a user