Anope IRC Services  Version 2.0
opertype.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
3  * Copyright (C) 2008-2014 Anope Team <team@anope.org>
4  *
5  * Please read COPYING and README for further details.
6  *
7  */
8 
9 #ifndef OPERTYPE_H
10 #define OPERTYPE_H
11 
12 #include "services.h"
13 #include "account.h"
14 
15 /* A services operator. Usually made by the configuration file, but not always.
16  * NickAlias::Find(name)->nc->o == this
17  */
19 {
20  /* The oper's nick */
22  /* The type of operator this operator is */
24  /* Whether the user must be an IRC operator (umode +o) to be considered a services operator */
28  /* Hosts allowed to use this operator block */
29  std::vector<Anope::string> hosts;
31 
32  Oper(const Anope::string &n, OperType *o);
33  virtual ~Oper();
34 
35  static std::vector<Oper *> opers;
36 
41  static Oper *Find(const Anope::string &name);
42 };
43 
45 {
46  private:
50 
54  std::list<Anope::string> privs;
55 
64  std::list<Anope::string> commands;
65 
68  std::set<OperType *> inheritances;
69  public:
73 
78  static OperType *Find(const Anope::string &name);
79 
83  OperType(const Anope::string &nname);
84 
89  bool HasCommand(const Anope::string &cmdstr) const;
90 
95  bool HasPriv(const Anope::string &privstr) const;
96 
100  void AddCommand(const Anope::string &cmdstr);
101 
105  void AddPriv(const Anope::string &privstr);
106 
109  const Anope::string &GetName() const;
110 
114  void Inherits(OperType *ot);
115 
119  const std::list<Anope::string> GetCommands() const;
120 
124  const std::list<Anope::string> GetPrivs() const;
125 };
126 
127 #endif // OPERTYPE_H
std::list< Anope::string > privs
Definition: opertype.h:54
Anope::string certfp
Definition: opertype.h:27
std::set< OperType * > inheritances
Definition: opertype.h:68
Definition: opertype.h:18
Anope::string name
Definition: opertype.h:21
Anope::string vhost
Definition: opertype.h:30
Anope::string name
Definition: opertype.h:49
Anope::string modes
Definition: opertype.h:72
static std::vector< Oper * > opers
Definition: opertype.h:35
OperType * ot
Definition: opertype.h:23
bool require_oper
Definition: opertype.h:25
#define CoreExport
Definition: services.h:62
static bool HasPriv(const AccessGroup &ag, const ChanAccess *access, const Anope::string &name)
Definition: access.cpp:358
std::list< Anope::string > commands
Definition: opertype.h:64
Anope::string password
Definition: opertype.h:26
std::vector< Anope::string > hosts
Definition: opertype.h:29