//========= Copyright ©, Valve LLC, All rights reserved. ============ // // Purpose: Makes enum-to-string and string-to-enum easier to declare // // $NoKeywords: $ //============================================================================= #ifndef GCENUMUTILS_H #define GCENUMUTILS_H #ifdef _WIN32 #pragma once #endif namespace GCSDK { struct EnumString_s { int nValue; const char *pszString; }; } // starts defining a enum value string map #define ENUMSTRINGS_START( etype ) static const GCSDK::EnumString_s s_##etype[] = { // ends defining a enum value string map. generates PchNameFromEnumName() #define ENUMSTRINGS_END( etype ) }; const char* PchNameFrom##etype( etype nValue ) \ { for( uint i=0; i