/** * 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 IoTWireless { namespace Model { namespace LogLevelMapper { static const int INFO_HASH = HashingUtils::HashString("INFO"); static const int ERROR__HASH = HashingUtils::HashString("ERROR"); static const int DISABLED_HASH = HashingUtils::HashString("DISABLED"); LogLevel GetLogLevelForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == INFO_HASH) { return LogLevel::INFO; } else if (hashCode == ERROR__HASH) { return LogLevel::ERROR_; } else if (hashCode == DISABLED_HASH) { return LogLevel::DISABLED; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return LogLevel::NOT_SET; } Aws::String GetNameForLogLevel(LogLevel enumValue) { switch(enumValue) { case LogLevel::INFO: return "INFO"; case LogLevel::ERROR_: return "ERROR"; case LogLevel::DISABLED: return "DISABLED"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace LogLevelMapper } // namespace Model } // namespace IoTWireless } // namespace Aws