mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:10:06 +00:00
Update radar site text
This commit is contained in:
parent
f6262bba65
commit
f71391e3b9
6 changed files with 70 additions and 7 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include <scwx/common/sites.hpp>
|
||||
#include <scwx/util/logger.hpp>
|
||||
|
||||
#include <format>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace scwx
|
||||
|
|
@ -90,6 +91,29 @@ std::string RadarSite::place() const
|
|||
return p->place_;
|
||||
}
|
||||
|
||||
std::string RadarSite::location_name() const
|
||||
{
|
||||
std::string locationName;
|
||||
|
||||
if (p->country_ == "USA")
|
||||
{
|
||||
locationName = std::format("{}, {}", p->place_, p->state_);
|
||||
}
|
||||
else if (std::all_of(p->state_.cbegin(),
|
||||
p->state_.cend(),
|
||||
[](char c) { return std::isdigit(c); }))
|
||||
{
|
||||
locationName = std::format("{}, {}", p->place_, p->country_);
|
||||
}
|
||||
else
|
||||
{
|
||||
locationName =
|
||||
std::format("{}, {}, {}", p->place_, p->state_, p->country_);
|
||||
}
|
||||
|
||||
return locationName;
|
||||
}
|
||||
|
||||
std::shared_ptr<RadarSite> RadarSite::Get(const std::string& id)
|
||||
{
|
||||
std::shared_ptr<RadarSite> radarSite = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue