mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 21:20:06 +00:00
Formatting iem_api_provider.cpp
This commit is contained in:
parent
d63c2a3ef9
commit
46972e8769
1 changed files with 11 additions and 15 deletions
|
|
@ -32,15 +32,13 @@ public:
|
||||||
IemApiProvider::IemApiProvider() : p(std::make_unique<Impl>()) {}
|
IemApiProvider::IemApiProvider() : p(std::make_unique<Impl>()) {}
|
||||||
IemApiProvider::~IemApiProvider() = default;
|
IemApiProvider::~IemApiProvider() = default;
|
||||||
|
|
||||||
IemApiProvider::IemApiProvider(IemApiProvider&&) noexcept =
|
IemApiProvider::IemApiProvider(IemApiProvider&&) noexcept = default;
|
||||||
default;
|
IemApiProvider& IemApiProvider::operator=(IemApiProvider&&) noexcept = default;
|
||||||
IemApiProvider&
|
|
||||||
IemApiProvider::operator=(IemApiProvider&&) noexcept = default;
|
|
||||||
|
|
||||||
std::vector<std::string> IemApiProvider::ListTextProducts(
|
std::vector<std::string>
|
||||||
std::chrono::sys_time<std::chrono::days> date,
|
IemApiProvider::ListTextProducts(std::chrono::sys_time<std::chrono::days> date,
|
||||||
std::optional<std::string_view> cccc,
|
std::optional<std::string_view> cccc,
|
||||||
std::optional<std::string_view> pil)
|
std::optional<std::string_view> pil)
|
||||||
{
|
{
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
|
|
||||||
|
|
@ -137,25 +135,23 @@ std::vector<std::string> IemApiProvider::ListTextProducts(
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::shared_ptr<awips::TextProductFile>>
|
std::vector<std::shared_ptr<awips::TextProductFile>>
|
||||||
IemApiProvider::LoadTextProducts(
|
IemApiProvider::LoadTextProducts(const std::vector<std::string>& textProducts)
|
||||||
const std::vector<std::string>& textProducts)
|
|
||||||
{
|
{
|
||||||
auto parameters = cpr::Parameters {{"nolimit", "true"}};
|
auto parameters = cpr::Parameters {{"nolimit", "true"}};
|
||||||
|
|
||||||
std::vector<std::pair<std::string_view, cpr::AsyncResponse>>
|
std::vector<std::pair<std::string_view, cpr::AsyncResponse>>
|
||||||
asyncResponses {};
|
asyncResponses {};
|
||||||
asyncResponses.reserve(textProducts.size());
|
asyncResponses.reserve(textProducts.size());
|
||||||
|
|
||||||
const std::string endpointUrl = kBaseUrl_ + kNwsTextProductEndpoint_;
|
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 {endpointUrl + productId},
|
||||||
cpr::Url {endpointUrl + productId},
|
network::cpr::GetHeader(),
|
||||||
network::cpr::GetHeader(),
|
parameters));
|
||||||
parameters));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::shared_ptr<awips::TextProductFile>> textProductFiles;
|
std::vector<std::shared_ptr<awips::TextProductFile>> textProductFiles;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue