/*
 * This file is auto-generated, do not modify!
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#include "config.h"

#include <glib.h>

#include "fu-cbor-struct.h"

#ifdef G_LOG_DOMAIN
  #undef G_LOG_DOMAIN
#endif
#define G_LOG_DOMAIN "FuStruct"

/**
 * fu_cbor_tag_to_string:
 * @val: value, e.g. %FU_CBOR_TAG_NEG_INT
 *
 * Converts an enumerated value to a string.
 *
 * Returns: identifier string
 **/
const gchar *
fu_cbor_tag_to_string(FuCborTag val)
{
    if (val == FU_CBOR_TAG_POS_INT)
        return "pos-int";
    if (val == FU_CBOR_TAG_NEG_INT)
        return "neg-int";
    if (val == FU_CBOR_TAG_BYTES)
        return "bytes";
    if (val == FU_CBOR_TAG_STRING)
        return "string";
    if (val == FU_CBOR_TAG_ARRAY)
        return "array";
    if (val == FU_CBOR_TAG_MAP)
        return "map";
    if (val == FU_CBOR_TAG_SEMANTIC)
        return "semantic";
    if (val == FU_CBOR_TAG_SPECIAL)
        return "special";
    return NULL;
}


/**
 * fu_cbor_special_value_to_string:
 * @val: value, e.g. %FU_CBOR_SPECIAL_VALUE_TRUE
 *
 * Converts an enumerated value to a string.
 *
 * Returns: identifier string
 **/
const gchar *
fu_cbor_special_value_to_string(FuCborSpecialValue val)
{
    if (val == FU_CBOR_SPECIAL_VALUE_FALSE)
        return "false";
    if (val == FU_CBOR_SPECIAL_VALUE_TRUE)
        return "true";
    if (val == FU_CBOR_SPECIAL_VALUE_NULL)
        return "null";
    if (val == FU_CBOR_SPECIAL_VALUE_UNDEFINED)
        return "undefined";
    if (val == FU_CBOR_SPECIAL_VALUE_EXTENDED)
        return "extended";
    if (val == FU_CBOR_SPECIAL_VALUE_FLOAT16)
        return "float16";
    if (val == FU_CBOR_SPECIAL_VALUE_FLOAT32)
        return "float32";
    if (val == FU_CBOR_SPECIAL_VALUE_FLOAT64)
        return "float64";
    if (val == FU_CBOR_SPECIAL_VALUE_BREAK)
        return "break";
    return NULL;
}

/**
 * fu_cbor_item_kind_to_string:
 * @val: value, e.g. %FU_CBOR_ITEM_KIND_BYTES
 *
 * Converts an enumerated value to a string.
 *
 * Returns: identifier string
 **/
const gchar *
fu_cbor_item_kind_to_string(FuCborItemKind val)
{
    if (val == FU_CBOR_ITEM_KIND_INTEGER)
        return "integer";
    if (val == FU_CBOR_ITEM_KIND_BYTES)
        return "bytes";
    if (val == FU_CBOR_ITEM_KIND_STRING)
        return "string";
    if (val == FU_CBOR_ITEM_KIND_ARRAY)
        return "array";
    if (val == FU_CBOR_ITEM_KIND_MAP)
        return "map";
    if (val == FU_CBOR_ITEM_KIND_BOOLEAN)
        return "boolean";
    return NULL;
}
