1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 17:43:13 +02:00

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
This commit is contained in:
cyberbotx
2009-10-18 21:10:39 +00:00
parent 12ac162d9e
commit 0d3ec454de
7 changed files with 39 additions and 14 deletions
+18
View File
@@ -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());
+1 -1
View File
@@ -188,4 +188,4 @@ const unsigned Version::GetMinor()
const unsigned Version::GetBuild()
{
return Build;
}
}
+2 -2
View File
@@ -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];