/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include using namespace Aws::Utils; namespace Aws { namespace Inspector2 { namespace Model { namespace CurrencyMapper { static const int USD_HASH = HashingUtils::HashString("USD"); Currency GetCurrencyForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == USD_HASH) { return Currency::USD; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return Currency::NOT_SET; } Aws::String GetNameForCurrency(Currency enumValue) { switch(enumValue) { case Currency::USD: return "USD"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace CurrencyMapper } // namespace Model } // namespace Inspector2 } // namespace Aws