diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-18 21:10:39 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-10-18 21:10:39 +0000 |
commit | 0d3ec454de486da5cbc292f7e694ee8ab7e4fae0 (patch) | |
tree | bf71bfec70f2f6d3b4110d38d0c2557edbe0908e /src | |
parent | 12ac162d9e025827339f68bdefa8c4d27b1051e7 (diff) |
Fix a few things that bugged me when I was working on one of my own modules.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2573 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/hashcomp.cpp | 18 | ||||
-rw-r--r-- | src/module.cpp | 2 | ||||
-rw-r--r-- | src/modules.c | 4 |
3 files changed, 21 insertions, 3 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 0636b3116..4ccaeebcb 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -112,6 +112,16 @@ sepstream::sepstream(const std::string &source, char seperator) : tokens(source) last_starting_position = n = tokens.begin(); } +sepstream::sepstream(const ci::string &source, char seperator) : tokens(source.c_str()), sep(seperator) +{ + last_starting_position = n = tokens.begin(); +} + +sepstream::sepstream(const char *source, char seperator) : tokens(source), sep(seperator) +{ + last_starting_position = n = tokens.begin(); +} + bool sepstream::GetToken(std::string &token) { std::string::iterator lsp = last_starting_position; @@ -138,6 +148,14 @@ bool sepstream::GetToken(std::string &token) return false; } +bool sepstream::GetToken(ci::string &token) +{ + std::string tmp_token; + bool result = GetToken(tmp_token); + token = tmp_token.c_str(); + return result; +} + const std::string sepstream::GetRemaining() { return std::string(n, tokens.end()); diff --git a/src/module.cpp b/src/module.cpp index 888087d85..fa4e41cd8 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -188,4 +188,4 @@ const unsigned Version::GetMinor() const unsigned Version::GetBuild() { return Build; -}
\ No newline at end of file +} diff --git a/src/modules.c b/src/modules.c index 1757cfcef..7eefd0c0a 100644 --- a/src/modules.c +++ b/src/modules.c @@ -631,7 +631,7 @@ void Module::AddCallBack(Timer *t) { it2 = it; ++it2; - + if (!TimerManager::IsTimer(*it)) { this->CallBacks.erase(it); @@ -732,7 +732,7 @@ bool moduleMinVersion(int major, int minor, int patch, int build) return ret; } -void Module::NoticeLang(char *source, User * u, int number, ...) +void Module::NoticeLang(const char *source, User * u, int number, ...) { va_list va; char buffer[4096], outbuf[4096]; |