2023-08-28 20:46:50 -07:00
|
|
|
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
2023-08-21 20:28:39 -07:00
|
|
|
#pragma once
|
2023-09-25 09:12:11 -07:00
|
|
|
#include "components/types.hpp"
|
2023-08-28 20:46:50 -07:00
|
|
|
#endif
|
2023-08-21 20:28:39 -07:00
|
|
|
|
2023-08-22 21:05:58 -07:00
|
|
|
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp)
|
2023-08-21 22:51:59 -07:00
|
|
|
|
2023-08-21 20:28:39 -07:00
|
|
|
namespace ESpecifier
|
|
|
|
{
|
|
|
|
enum Type : u32
|
|
|
|
{
|
|
|
|
Invalid,
|
|
|
|
Consteval,
|
|
|
|
Constexpr,
|
|
|
|
Constinit,
|
|
|
|
Explicit,
|
|
|
|
External_Linkage,
|
|
|
|
ForceInline,
|
|
|
|
Global,
|
|
|
|
Inline,
|
|
|
|
Internal_Linkage,
|
|
|
|
Local_Persist,
|
|
|
|
Mutable,
|
|
|
|
NeverInline,
|
|
|
|
Ptr,
|
|
|
|
Ref,
|
|
|
|
Register,
|
|
|
|
RValue,
|
|
|
|
Static,
|
|
|
|
Thread_Local,
|
|
|
|
Volatile,
|
|
|
|
Virtual,
|
|
|
|
Const,
|
|
|
|
Final,
|
2023-09-04 22:44:04 -07:00
|
|
|
NoExceptions,
|
2023-08-21 20:28:39 -07:00
|
|
|
Override,
|
|
|
|
Pure,
|
|
|
|
NumSpecifiers
|
|
|
|
};
|
|
|
|
|
|
|
|
bool is_trailing( Type specifier )
|
|
|
|
{
|
|
|
|
return specifier > Virtual;
|
|
|
|
}
|
|
|
|
|
|
|
|
StrC to_str( Type type )
|
|
|
|
{
|
|
|
|
local_persist StrC lookup[] {
|
|
|
|
{sizeof( "INVALID" ), "INVALID" },
|
|
|
|
{ sizeof( "consteval" ), "consteval" },
|
|
|
|
{ sizeof( "constexpr" ), "constexpr" },
|
|
|
|
{ sizeof( "constinit" ), "constinit" },
|
|
|
|
{ sizeof( "explicit" ), "explicit" },
|
|
|
|
{ sizeof( "extern" ), "extern" },
|
|
|
|
{ sizeof( "forceinline" ), "forceinline" },
|
|
|
|
{ sizeof( "global" ), "global" },
|
|
|
|
{ sizeof( "inline" ), "inline" },
|
|
|
|
{ sizeof( "internal" ), "internal" },
|
|
|
|
{ sizeof( "local_persist" ), "local_persist"},
|
|
|
|
{ sizeof( "mutable" ), "mutable" },
|
|
|
|
{ sizeof( "neverinline" ), "neverinline" },
|
|
|
|
{ sizeof( "*" ), "*" },
|
|
|
|
{ sizeof( "&" ), "&" },
|
|
|
|
{ sizeof( "register" ), "register" },
|
|
|
|
{ sizeof( "&&" ), "&&" },
|
|
|
|
{ sizeof( "static" ), "static" },
|
|
|
|
{ sizeof( "thread_local" ), "thread_local" },
|
|
|
|
{ sizeof( "volatile" ), "volatile" },
|
|
|
|
{ sizeof( "virtual" ), "virtual" },
|
|
|
|
{ sizeof( "const" ), "const" },
|
|
|
|
{ sizeof( "final" ), "final" },
|
2023-09-04 22:44:04 -07:00
|
|
|
{ sizeof( "noexcept" ), "noexcept" },
|
2023-08-21 20:28:39 -07:00
|
|
|
{ sizeof( "override" ), "override" },
|
|
|
|
{ sizeof( "= 0" ), "= 0" },
|
|
|
|
};
|
|
|
|
return lookup[ type ];
|
|
|
|
}
|
|
|
|
|
|
|
|
Type to_type( StrC str )
|
|
|
|
{
|
|
|
|
local_persist u32 keymap[ NumSpecifiers ];
|
|
|
|
do_once_start for ( u32 index = 0; index < NumSpecifiers; index++ )
|
|
|
|
{
|
|
|
|
StrC enum_str = to_str( ( Type )index );
|
|
|
|
keymap[ index ] = crc32( enum_str.Ptr, enum_str.Len - 1 );
|
|
|
|
}
|
|
|
|
do_once_end u32 hash = crc32( str.Ptr, str.Len );
|
|
|
|
for ( u32 index = 0; index < NumSpecifiers; index++ )
|
|
|
|
{
|
|
|
|
if ( keymap[ index ] == hash )
|
|
|
|
return ( Type )index;
|
|
|
|
}
|
|
|
|
return Invalid;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace ESpecifier
|
|
|
|
|
|
|
|
using SpecifierT = ESpecifier::Type;
|