From 4addb711c6a1a282b0a59bf03e850a86ba2ead69 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 8 Jan 2017 22:43:35 +0100 Subject: Initial --- command.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 command.h (limited to 'command.h') diff --git a/command.h b/command.h new file mode 100644 index 0000000..5ee7d24 --- /dev/null +++ b/command.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include + +#include "global.h" + +using namespace std; + + +class Command{ + const string cmd; + const vector args; + +public: + Command(string cmd); + Command(string cmd,vector args); + Command(string cmd,initializer_list l); + Command(initializer_list l); + template + Command(string cmd,A... a) + :cmd(cmd),args{a...}{} + + const string& command() const; + const vector& arguments() const; + const string& argument(i64 index) const; + const string& operator[](i64 index) const; // 0 is command, >=1 is arguments +}; -- cgit v1.2.3-54-g00ecf