carb/RStringEnum.inl

File members: carb/RStringEnum.inl

// Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//

// This file is purposely missing #pragma once or any sort of include guard as it is included multiple times.

#if !defined(RSTRINGENUM_FROM_RSTRING_H) && !defined(RSTRINGENUM_FROM_RSTRING_INL)
#    error This file may only be included from RString.h or RString.inl.
#endif

#if (defined(__INTELLISENSE__) && defined(RSTRINGENUM_FROM_RSTRING_H)) || !defined(ENTRY) || defined(DOXYGEN_BUILD)
namespace carb
{

constexpr size_t kMaxStaticRString = 500;

#    ifndef DOXYGEN_SHOULD_SKIP_THIS
#        define ENTRY(index, name) RS_##name = index,
#        define EMPTY_ENTRY(index, name) name = index,
#        define BUILDING_ENUM 1
#    endif

enum class eRString : unsigned
{
#else
#    define BUILDING_ENUM 0
#endif

    // clang-format off
// For step 4 in the Increasing Version checklist in RStringInternals.inl, copy the block below into the saved-off
// version of RStringInternals.inl
// vvvvvvvvvv

EMPTY_ENTRY(0, Empty)
ENTRY(1, RString)
ENTRY(2, carb)
ENTRY(3, omni)
ENTRY(4, Carbonite)
ENTRY(5, Omniverse)
ENTRY(6, None)
ENTRY(7, null)
ENTRY(8, bool)
ENTRY(9, uint8)
ENTRY(10, uint16)
ENTRY(11, uint32)
ENTRY(12, uint64)
ENTRY(13, int8)
ENTRY(14, int16)
ENTRY(15, int32)
ENTRY(16, int64)
ENTRY(17, float)
ENTRY(18, double)
ENTRY(19, string)
ENTRY(20, charptr)
ENTRY(21, dictionary)
ENTRY(22, variant_pair)
ENTRY(23, variant_array)
ENTRY(24, RStringU)
ENTRY(25, RStringKey)
ENTRY(26, RStringUKey)
ENTRY(27, variant_map)

// ^^^^^^^^^^
// For step 4 in the Increasing Version checklist in RStringInternals.inl, copy the block above into the saved-off
// version of RStringInternals.inl
// clang-format on

#if BUILDING_ENUM
    RS_Max
};

static_assert(unsigned(eRString::RS_Max) <= kMaxStaticRString, "Too many static RString values!");
#    undef ENTRY
#    undef EMPTY_ENTRY
} // namespace carb
#endif
#undef BUILDING_ENUM