diff options
| -rw-r--r-- | src/schemas/stream.cpp | 17 | ||||
| -rw-r--r-- | src/schemas/stream.hpp | 5 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/schemas/stream.cpp b/src/schemas/stream.cpp new file mode 100644 index 0000000..6ef10dc --- /dev/null +++ b/src/schemas/stream.cpp @@ -0,0 +1,17 @@ +#include "stream.hpp" + +namespace bot::schemas { + EventType string_to_event_type(const std::string &type) { + if (type == "live") { + return EventType::LIVE; + } else if (type == "offline") { + return EventType::OFFLINE; + } else if (type == "title") { + return EventType::TITLE; + } else if (type == "game") { + return EventType::GAME; + } else { + return EventType::CUSTOM; + } + } +} diff --git a/src/schemas/stream.hpp b/src/schemas/stream.hpp index bfb60b5..a636ea5 100644 --- a/src/schemas/stream.hpp +++ b/src/schemas/stream.hpp @@ -1,6 +1,11 @@ #pragma once +#include <string> + namespace bot::schemas { enum EventType { LIVE, OFFLINE, TITLE, GAME, CUSTOM = 99 }; + EventType string_to_event_type(const std::string &type); + enum EventFlag { MASSPING }; + } |
