From d400369084107104f51fe217d5781c8d7bd07ff9 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 10 Mar 2025 00:20:31 +0530 Subject: Add dumb command parser --- include/CommandParser.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/CommandParser.hpp (limited to 'include/CommandParser.hpp') diff --git a/include/CommandParser.hpp b/include/CommandParser.hpp new file mode 100644 index 0000000..128b5f4 --- /dev/null +++ b/include/CommandParser.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include +#include + +enum CommandType { + Noop, + LuaEval, + Open, + TabOpen, + TabNext, + TabPrev, +}; + +class Cmd { +public: + CommandType command; + QStringList args; + + Cmd(CommandType command = Noop, QStringList args = QStringList()) + : command(command), args(args) {} +}; + +class CommandParser { +public: + CommandParser(); + Cmd parse(QString command); + +private: + CommandType toCommandType(QString cmd); +}; -- cgit v1.3.1