mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 13:10:05 +00:00
General linter cleanup
This commit is contained in:
parent
e6cfef06a7
commit
8da440ea1f
3 changed files with 17 additions and 7 deletions
|
|
@ -12,14 +12,14 @@
|
||||||
# include <arpa/inet.h>
|
# include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace scwx
|
namespace scwx::awips
|
||||||
{
|
|
||||||
namespace awips
|
|
||||||
{
|
{
|
||||||
|
|
||||||
static const std::string logPrefix_ = "scwx::awips::wmo_header";
|
static const std::string logPrefix_ = "scwx::awips::wmo_header";
|
||||||
static const auto logger_ = util::Logger::Create(logPrefix_);
|
static const auto logger_ = util::Logger::Create(logPrefix_);
|
||||||
|
|
||||||
|
static constexpr std::size_t kWmoHeaderMinLineLength_ = 18;
|
||||||
|
|
||||||
class WmoHeaderImpl
|
class WmoHeaderImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -37,6 +37,11 @@ public:
|
||||||
}
|
}
|
||||||
~WmoHeaderImpl() = default;
|
~WmoHeaderImpl() = default;
|
||||||
|
|
||||||
|
WmoHeaderImpl(const WmoHeaderImpl&) = delete;
|
||||||
|
WmoHeaderImpl& operator=(const WmoHeaderImpl&) = delete;
|
||||||
|
WmoHeaderImpl(const WmoHeaderImpl&&) = delete;
|
||||||
|
WmoHeaderImpl& operator=(const WmoHeaderImpl&&) = delete;
|
||||||
|
|
||||||
bool operator==(const WmoHeaderImpl& o) const;
|
bool operator==(const WmoHeaderImpl& o) const;
|
||||||
|
|
||||||
std::string sequenceNumber_;
|
std::string sequenceNumber_;
|
||||||
|
|
@ -138,8 +143,9 @@ bool WmoHeader::Parse(std::istream& is)
|
||||||
{
|
{
|
||||||
// The next line could be the WMO line or the sequence line
|
// The next line could be the WMO line or the sequence line
|
||||||
util::getline(is, wmoLine);
|
util::getline(is, wmoLine);
|
||||||
if (wmoLine.length() < 18)
|
if (wmoLine.length() < kWmoHeaderMinLineLength_)
|
||||||
{
|
{
|
||||||
|
// This is likely the sequence line instead
|
||||||
sequenceLine.swap(wmoLine);
|
sequenceLine.swap(wmoLine);
|
||||||
util::getline(is, wmoLine);
|
util::getline(is, wmoLine);
|
||||||
}
|
}
|
||||||
|
|
@ -249,5 +255,4 @@ bool WmoHeader::Parse(std::istream& is)
|
||||||
return headerValid;
|
return headerValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace awips
|
} // namespace scwx::awips
|
||||||
} // namespace scwx
|
|
||||||
|
|
|
||||||
|
|
@ -144,13 +144,16 @@ IemWarningsProvider::LoadTextProducts(
|
||||||
|
|
||||||
std::vector<std::pair<std::string_view, cpr::AsyncResponse>>
|
std::vector<std::pair<std::string_view, cpr::AsyncResponse>>
|
||||||
asyncResponses {};
|
asyncResponses {};
|
||||||
|
asyncResponses.reserve(textProducts.size());
|
||||||
|
|
||||||
|
const std::string endpointUrl = kBaseUrl_ + kNwsTextProductEndpoint_;
|
||||||
|
|
||||||
for (auto& productId : textProducts)
|
for (auto& productId : textProducts)
|
||||||
{
|
{
|
||||||
asyncResponses.emplace_back(
|
asyncResponses.emplace_back(
|
||||||
productId,
|
productId,
|
||||||
cpr::GetAsync(
|
cpr::GetAsync(
|
||||||
cpr::Url {kBaseUrl_ + kNwsTextProductEndpoint_ + productId},
|
cpr::Url {endpointUrl + productId},
|
||||||
network::cpr::GetHeader(),
|
network::cpr::GetHeader(),
|
||||||
parameters));
|
parameters));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,8 @@ void WriteJsonFile(const std::string& path,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow recursion within the pretty print function
|
||||||
|
// NOLINTNEXTLINE(misc-no-recursion)
|
||||||
static void PrettyPrintJson(std::ostream& os,
|
static void PrettyPrintJson(std::ostream& os,
|
||||||
boost::json::value const& jv,
|
boost::json::value const& jv,
|
||||||
std::string* indent)
|
std::string* indent)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue