Files
MapLibreParticleLab/src/mbgl/platform/event.cpp
John Firebaugh 282e626ac1 [core] Make enum ↔ string conversion more generic-friendly
Rewrite enum.hpp in such a way that parseConstant can be defined generically for all enumerated types.

While there, properly validated enumerated property values.
2016-06-13 17:22:05 -07:00

35 lines
944 B
C++

#include <mbgl/platform/event.hpp>
#include <mbgl/util/enum.hpp>
namespace mbgl {
MBGL_DEFINE_ENUM(EventSeverity, {
{ EventSeverity::Debug, "DEBUG" },
{ EventSeverity::Info, "INFO" },
{ EventSeverity::Warning, "WARNING" },
{ EventSeverity::Error, "ERROR" },
{ EventSeverity(-1), "UNKNOWN" },
});
MBGL_DEFINE_ENUM(Event, {
{ Event::General, "General" },
{ Event::Setup, "Setup" },
{ Event::Shader, "Shader" },
{ Event::ParseStyle, "ParseStyle" },
{ Event::ParseTile, "ParseTile" },
{ Event::Render, "Render" },
{ Event::Style, "Style" },
{ Event::Database, "Database" },
{ Event::HttpRequest, "HttpRequest" },
{ Event::Sprite, "Sprite" },
{ Event::Image, "Image" },
{ Event::OpenGL, "OpenGL" },
{ Event::JNI, "JNI" },
{ Event::Android, "Android" },
{ Event::Crash, "Crash" },
{ Event::Glyph, "Glyph" },
{ Event(-1), "Unknown" },
});
} // namespace mbgl