Euphoria
enum.h File Reference
#include <map>

Go to the source code of this file.

Classes

struct  eu::core::EnumType
 Represents a dynamically loaded "enum type". More...
 
struct  eu::core::EnumValue
 

Namespaces

 eu
 
 eu::io
 
 eu::core
 

Macros

#define DECLARE_ENUM_TYPE(NAME)   EnumType& NAME##_EnumType();
 
#define IMPLEMENT_ENUM_TYPE(NAME)
 
#define DEFINE_ENUM_VALUE(TYPE, NAME, STRING)    const ::eu::core::EnumValue NAME = TYPE##_EnumType().to_enum(STRING)
 
#define SET_ENUM_FROM_FILE(FS, PATH, TYPE)    load_enum_type(&TYPE##_EnumType(), FS, PATH)
 

Functions

std::string eu::core::to_string (const EnumValue &v)
 
void eu::core::load_enum_type (EnumType *type, io::FileSystem *fs, const io::FilePath &path)
 
 ADD_DEFAULT_FORMATTER (eu::core::EnumValue, std::string, eu::core::to_string)
 

Macro Definition Documentation

◆ DECLARE_ENUM_TYPE

#define DECLARE_ENUM_TYPE (   NAME)    EnumType& NAME##_EnumType();

Definition at line 83 of file enum.h.

◆ DEFINE_ENUM_VALUE

#define DEFINE_ENUM_VALUE (   TYPE,
  NAME,
  STRING 
)     const ::eu::core::EnumValue NAME = TYPE##_EnumType().to_enum(STRING)

Definition at line 95 of file enum.h.

◆ IMPLEMENT_ENUM_TYPE

#define IMPLEMENT_ENUM_TYPE (   NAME)
Value:
EnumType& NAME##_EnumType() \
{ \
static EnumType type {#NAME}; \
return type; \
}

Definition at line 84 of file enum.h.

◆ SET_ENUM_FROM_FILE

#define SET_ENUM_FROM_FILE (   FS,
  PATH,
  TYPE 
)     load_enum_type(&TYPE##_EnumType(), FS, PATH)

Definition at line 97 of file enum.h.

Function Documentation

◆ ADD_DEFAULT_FORMATTER()

ADD_DEFAULT_FORMATTER ( eu::core::EnumValue  ,
std::string  ,
eu::core::to_string   
)