From 085cd4278f0f495c6d008a3d157026b33a23b787 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 16 Jul 2006 15:08:59 +0000 Subject: Created new class irc::commasepstream. Will read comma seperated lists and works identically to irc::tokenstream It's re-entrant so we can run two of them together for JOIN git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4412 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/command_parse.h | 3 ++- include/hashcomp.h | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/command_parse.h b/include/command_parse.h index 15e0f1446..800f2beeb 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -36,7 +36,8 @@ class CommandParser : public classbase CommandParser(); bool CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user); bool IsValidCommand(const std::string &commandname, int pcnt, userrec * user); - int LoopCall(command_t *fn, const char** parameters, int pcnt, userrec *u, int start, int end, int joins); + int LoopCall(userrec* user, command_t* CommandObj, const char** parameters, int pcnt, unsigned int splithere, unsigned int extra); + int LoopCall(userrec* user, command_t* CommandObj, const char** parameters, int pcnt, unsigned int splithere); void ProcessBuffer(std::string &buffer,userrec *user); bool RemoveCommands(const char* source); bool CreateCommand(command_t *f); diff --git a/include/hashcomp.h b/include/hashcomp.h index 22e9f1470..f6c9368d6 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -93,6 +93,19 @@ namespace irc const std::string GetToken(); }; + class commasepstream + { + private: + std::string tokens; + std::string::iterator last_starting_position; + std::string::iterator n; + public: + commasepstream(const std::string &source); + ~commasepstream(); + + const std::string GetToken(); + }; + /** The irc_char_traits class is used for RFC-style comparison of strings. * This class is used to implement irc::string, a case-insensitive, RFC- -- cgit v1.2.3