Anope IRC Services  Version 2.0
lists.h
Go to the documentation of this file.
1 /*
2  *
3  * (C) 2003-2014 Anope Team
4  * Contact us at team@anope.org
5  *
6  * Please read COPYING and README for further details.
7  *
8  * Based on the original code of Epona by Lara.
9  * Based on the original code of Services by Andy Church.
10  *
11  */
12 
13 #ifndef LISTS_H
14 #define LISTS_H
15 
16 #include "services.h"
17 #include "anope.h"
18 
27 {
28  private:
29  bool is_valid;
30 
31  std::set<unsigned> numbers;
32 
33  bool desc;
34  public:
39  NumberList(const Anope::string &list, bool descending);
40 
43  virtual ~NumberList();
44 
47  void Process();
48 
52  virtual void HandleNumber(unsigned number);
53 
60  virtual bool InvalidRange(const Anope::string &list);
61 };
62 
66 {
67  public:
68  typedef std::map<Anope::string, Anope::string> ListEntry;
69  private:
71  std::vector<Anope::string> columns;
72  std::vector<ListEntry> entries;
73  public:
75  ListFormatter &AddColumn(const Anope::string &name);
76  void AddEntry(const ListEntry &entry);
77  bool IsEmpty() const;
78  void Process(std::vector<Anope::string> &);
79 };
80 
84 {
86  std::vector<std::pair<Anope::string, Anope::string> > replies;
87  unsigned longest;
88  public:
90  void Process(std::vector<Anope::string> &);
91  Anope::string &operator[](const Anope::string &key);
92  void AddOption(const Anope::string &opt);
93 };
94 
95 #endif // LISTS_H
96 
unsigned longest
Definition: lists.h:87
NickCore * nc
Definition: lists.h:85
std::vector< std::pair< Anope::string, Anope::string > > replies
Definition: lists.h:86
std::vector< ListEntry > entries
Definition: lists.h:72
std::map< Anope::string, Anope::string > ListEntry
Definition: lists.h:68
bool desc
Definition: lists.h:33
NickCore * nc
Definition: lists.h:70
#define CoreExport
Definition: services.h:62
Anope::string name
Definition: access.cpp:22
std::vector< Anope::string > columns
Definition: lists.h:71
void Process(const Anope::string &)
Definition: process.cpp:19
bool is_valid
Definition: lists.h:29
std::set< unsigned > numbers
Definition: lists.h:31