message parser

Add magic enum
Add function to parse commands
Add function to parse events
Add function to feed json input to there corresponding parse functions and return there result
This commit is contained in:
2024-08-22 13:57:32 +02:00
parent 45263970fc
commit e12263b8d2
3 changed files with 139 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
#pragma once
#include "simulators.hpp"
enum class Command
{
get_UI_element,
get_UI_elements,
switch_simulator,
get_active_simulator_name,
get_simulators,
end,
begin = 0
};
enum class Event
{
clicked,
value_changed,
text_changed,
selected,
ui_changed,
end,
begin = 0
};
std::string message_parser(std::string message);
json command_parser(json command);
void event_handler(json event);