blob: ae2dd4ba356f5255b64b2cd03414d1039aaae8bc [file] [log] [blame]
#pragma once
#include "utils/conversion.hpp"
#include <sdbusplus/exception.hpp>
#include <array>
#include <cstdint>
#include <string_view>
#include <type_traits>
enum class ErrorType : uint32_t
{
propertyConflict
};
namespace utils
{
template <>
struct EnumTraits<ErrorType>
{
static constexpr auto propertyName = ConstexprString{"ErrorType"};
};
constexpr auto convDataErrorType = std::array{
std::make_pair<std::string_view, ErrorType>("PropertyConflict",
ErrorType::propertyConflict)};
inline ErrorType toErrorType(std::underlying_type_t<ErrorType> value)
{
return toEnum<ErrorType, minEnumValue(convDataErrorType),
maxEnumValue(convDataErrorType)>(value);
}
inline ErrorType toErrorType(const std::string& value)
{
return toEnum(convDataErrorType, value);
}
inline std::string enumToString(ErrorType value)
{
return std::string(enumToString(convDataErrorType, value));
}
} // namespace utils