diff options
author | Adam <Adam@anope.org> | 2011-12-19 15:37:15 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-12-19 15:37:15 -0500 |
commit | 45fc3ce1c41b06af6e03712988870ead95b72435 (patch) | |
tree | 7b574d077f77707edb3916fb43dfa30dec8b0f54 /include/services.h | |
parent | d320c73f23ff7a9b848b86b59c6bf91c1254e410 (diff) |
Fixed formatting of many lists and INFO outputs
Diffstat (limited to 'include/services.h')
-rw-r--r-- | include/services.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/services.h b/include/services.h index 1da51e296..3bf8d4494 100644 --- a/include/services.h +++ b/include/services.h @@ -915,4 +915,29 @@ class CoreExport NumberList virtual bool InvalidRange(const Anope::string &list); }; +class CoreExport ListFormatter +{ + public: + typedef std::map<Anope::string, Anope::string> ListEntry; + private: + std::vector<Anope::string> columns; + std::vector<ListEntry> entries; + public: + ListFormatter &addColumn(const Anope::string &name); + void addEntry(const ListEntry &entry); + bool isEmpty() const; + void Process(std::vector<Anope::string> &); +}; + +class CoreExport InfoFormatter +{ + User *user; + std::vector<std::pair<Anope::string, Anope::string> > replies; + unsigned longest; + public: + InfoFormatter(User *u); + void Process(std::vector<Anope::string> &); + Anope::string &operator[](const Anope::string &key); +}; + #endif /* SERVICES_H */ |