blob: f3bc7ad1f9879b1a5cf08b9e3ef9a4954427f491 (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
/*
* Copyright (C) 2008-2009 Robin Burchell <w00t@inspircd.org>
* Copyright (C) 2008-2009 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*
*
* $Id$
*
*/
#include "services.h"
#include "modules.h"
Command::Command(const std::string &sname, size_t min_params, size_t max_params, const std::string &spermission) : MaxParams(max_params), MinParams(min_params), name(sname), permission(spermission)
{
this->flags = 0;
this->help_param1 = NULL;
this->help_param2 = NULL;
this->help_param3 = NULL;
this->help_param4 = NULL;
this->core = 0;
this->mod_name = NULL;
this->service = NULL;
this->next = NULL;
}
Command::~Command()
{
if (this->mod_name) {
delete [] this->mod_name;
}
if (this->service) {
delete [] this->service;
}
}
CommandReturn Command::Execute(User *u, std::vector<ci::string> &) { return MOD_CONT; }
bool Command::OnHelp(User *u, const ci::string &subcommand) { return false; }
void Command::OnSyntaxError(User *u) { }
void Command::SetFlag(CommandFlags flag)
{
this->flags |= flag;
}
void Command::UnsetFlag(CommandFlags flag)
{
this->flags &= ~flag;
}
bool Command::HasFlag(CommandFlags flag) const
{
return this->flags & flag;
}
void Command::SetPermission(const std::string &reststr)
{
this->permission = reststr;
}
|