#pragma once #include #include #include #include #include "crow.h" namespace Handler { typedef crow::json::wvalue json; typedef std::function handler_function; typedef std::function()> description_function; struct CommandHandler { CommandHandler(std::string command, handler_function *func, description_function *desc, void *payload = nullptr); CommandHandler(CommandHandler &&o) noexcept { command = std::move(o.command); func = std::move(o.func); get_description = std::move(get_description); payload = o.payload; }; [[nodiscard]] json exec(std::string const &arguments, std::string const &session) const; std::string command; handler_function *func{nullptr}; description_function *get_description{nullptr}; void *payload{nullptr}; }; std::vector tokenizeArguments(std::string const &arguments, std::string const &delimiter = " "); }