old-trainOS/trainscript/typeid.hpp

27 lines
461 B
C++
Raw Normal View History

#pragma once
namespace trainscript
{
enum class TypeID
{
Invalid = 0,
Void = 1,
Int = 2,
Real = 3,
Text = 4,
2015-08-10 14:37:16 +00:00
Bool = 5,
};
static const char *typeName(TypeID id) {
switch(id) {
case TypeID::Invalid: return "INVALID";
case TypeID::Void: return "VOID";
case TypeID::Int: return "INT";
case TypeID::Real: return "REAL";
case TypeID::Text: return "TEXT";
2015-08-10 14:37:16 +00:00
case TypeID::Bool: return "BOOL";
default: return "unknown";
}
}
}