blob: f0b708d97cb9aae9d4999518313722860eb02f43 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#pragma once
#include <initializer_list>
#include <string>
#include <vector>
#include "global.h"
using namespace std;
class Command{
const string cmd;
const vector<string> args;
public:
Command(string cmd);
Command(string cmd,vector<string> args);
Command(string cmd,initializer_list<string> l);
Command(initializer_list<string> l);
template <typename... A>
Command(string cmd,A... a)
:cmd(cmd),args{a...}{}
Command(const Command &other) = default;
const string& command() const;
const vector<string>& arguments() const;
const string& argument(i64 index) const;
const string& operator[](i64 index) const; // 0 is command, >=1 is arguments
};
|