/** * 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 AlexaForBusiness { namespace Model { namespace LocaleMapper { static const int en_US_HASH = HashingUtils::HashString("en-US"); Locale GetLocaleForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == en_US_HASH) { return Locale::en_US; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return Locale::NOT_SET; } Aws::String GetNameForLocale(Locale enumValue) { switch(enumValue) { case Locale::en_US: return "en-US"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace LocaleMapper } // namespace Model } // namespace AlexaForBusiness } // namespace Aws