mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:40:05 +00:00
Look up product code when unavailable
This commit is contained in:
parent
822e523400
commit
0ca1ec2269
3 changed files with 31 additions and 0 deletions
|
|
@ -329,6 +329,30 @@ const std::string& GetLevel3ProductDescription(const std::string& productName)
|
|||
}
|
||||
}
|
||||
|
||||
int16_t GetLevel3ProductCodeByAwipsId(const std::string& awipsId)
|
||||
{
|
||||
const std::string& productName {GetLevel3ProductByAwipsId(awipsId)};
|
||||
const int16_t productCode {GetLevel3ProductCodeByProduct(productName)};
|
||||
|
||||
return productCode;
|
||||
}
|
||||
|
||||
int16_t GetLevel3ProductCodeByProduct(const std::string& productName)
|
||||
{
|
||||
auto it = std::find_if(level3ProductCodeMap_.cbegin(),
|
||||
level3ProductCodeMap_.cend(),
|
||||
[&](auto&& p) { return p.second == productName; });
|
||||
|
||||
if (it != level3ProductCodeMap_.cend())
|
||||
{
|
||||
return static_cast<int16_t>(it->first);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<std::string>&
|
||||
GetLevel3ProductsByCategory(Level3ProductCategory category)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue