This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-transcribestreaming/source/model/LanguageCode.cpp

99 lines
2.9 KiB
C++
Raw Normal View History

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/transcribestreaming/model/LanguageCode.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace TranscribeStreamingService
{
namespace Model
{
namespace LanguageCodeMapper
{
static const int en_US_HASH = HashingUtils::HashString("en-US");
static const int en_GB_HASH = HashingUtils::HashString("en-GB");
static const int es_US_HASH = HashingUtils::HashString("es-US");
static const int fr_CA_HASH = HashingUtils::HashString("fr-CA");
static const int fr_FR_HASH = HashingUtils::HashString("fr-FR");
static const int en_AU_HASH = HashingUtils::HashString("en-AU");
LanguageCode GetLanguageCodeForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == en_US_HASH)
{
return LanguageCode::en_US;
}
else if (hashCode == en_GB_HASH)
{
return LanguageCode::en_GB;
}
else if (hashCode == es_US_HASH)
{
return LanguageCode::es_US;
}
else if (hashCode == fr_CA_HASH)
{
return LanguageCode::fr_CA;
}
else if (hashCode == fr_FR_HASH)
{
return LanguageCode::fr_FR;
}
else if (hashCode == en_AU_HASH)
{
return LanguageCode::en_AU;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<LanguageCode>(hashCode);
}
return LanguageCode::NOT_SET;
}
Aws::String GetNameForLanguageCode(LanguageCode enumValue)
{
switch(enumValue)
{
case LanguageCode::en_US:
return "en-US";
case LanguageCode::en_GB:
return "en-GB";
case LanguageCode::es_US:
return "es-US";
case LanguageCode::fr_CA:
return "fr-CA";
case LanguageCode::fr_FR:
return "fr-FR";
case LanguageCode::en_AU:
return "en-AU";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace LanguageCodeMapper
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws