diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-03-10 00:20:31 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-03-10 00:20:31 +0530 |
| commit | d400369084107104f51fe217d5781c8d7bd07ff9 (patch) | |
| tree | c1e6572063a49a8c9da4d3c72355e02fb3fc187f /include/CommandParser.hpp | |
| parent | 6b1d49e607da16853d1a0f460dbe756538e4790c (diff) | |
| download | null-browser-d400369084107104f51fe217d5781c8d7bd07ff9.tar.gz null-browser-d400369084107104f51fe217d5781c8d7bd07ff9.zip | |
Add dumb command parser
Diffstat (limited to 'include/CommandParser.hpp')
| -rw-r--r-- | include/CommandParser.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
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 <QtCore/qcontainerfwd.h> +#include <QtCore> + +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); +}; |
