/** * 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 KinesisVideoArchivedMedia { namespace Model { namespace FormatMapper { static const int JPEG_HASH = HashingUtils::HashString("JPEG"); static const int PNG_HASH = HashingUtils::HashString("PNG"); Format GetFormatForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == JPEG_HASH) { return Format::JPEG; } else if (hashCode == PNG_HASH) { return Format::PNG; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return Format::NOT_SET; } Aws::String GetNameForFormat(Format enumValue) { switch(enumValue) { case Format::JPEG: return "JPEG"; case Format::PNG: return "PNG"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace FormatMapper } // namespace Model } // namespace KinesisVideoArchivedMedia } // namespace Aws