summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/hashcomp.h7
-rw-r--r--include/modules.h8
-rw-r--r--include/regchannel.h2
-rw-r--r--include/services.h12
-rw-r--r--src/hashcomp.cpp18
-rw-r--r--src/module.cpp2
-rw-r--r--src/modules.c4
7 files changed, 39 insertions, 14 deletions
diff --git a/include/hashcomp.h b/include/hashcomp.h
index e8cc488e0..4fb7e5a20 100644
--- a/include/hashcomp.h
+++ b/include/hashcomp.h
@@ -425,6 +425,8 @@ class CoreExport sepstream
/** Create a sepstream and fill it with the provided data
*/
sepstream(const std::string &source, char seperator);
+ sepstream(const ci::string &source, char seperator);
+ sepstream(const char *source, char seperator);
virtual ~sepstream() { }
/** Fetch the next token from the stream
@@ -432,6 +434,7 @@ class CoreExport sepstream
* @return True if tokens still remain, false if there are none left
*/
virtual bool GetToken(std::string &token);
+ virtual bool GetToken(ci::string &token);
/** Fetch the entire remaining stream, without tokenizing
* @return The remaining part of the stream
@@ -452,6 +455,8 @@ class CoreExport commasepstream : public sepstream
/** Initialize with comma seperator
*/
commasepstream(const std::string &source) : sepstream(source, ',') { }
+ commasepstream(const ci::string &source) : sepstream(source, ',') { }
+ commasepstream(const char *source) : sepstream(source, ',') { }
};
/** A derived form of sepstream, which seperates on spaces
@@ -462,6 +467,8 @@ class CoreExport spacesepstream : public sepstream
/** Initialize with space seperator
*/
spacesepstream(const std::string &source) : sepstream(source, ' ') { }
+ spacesepstream(const ci::string &source) : sepstream(source, ' ') { }
+ spacesepstream(const char *source) : sepstream(source, ' ') { }
};
#endif
diff --git a/include/modules.h b/include/modules.h
index 6d9e36d9a..4e02d3b97 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -471,7 +471,7 @@ class CoreExport Module
* @param number The message number
* @param ... The argument list
**/
- void NoticeLang(char *source, User * u, int number, ...);
+ void NoticeLang(const char *source, User * u, int number, ...);
/**
* Add a module provided command to the given service.
@@ -721,7 +721,7 @@ class CoreExport Module
*/
virtual void OnServerQuit(Server *server) { }
- /** Called on a QUIT
+ /** Called on a QUIT
* @param u The user
* @param msg The quit message
*/
@@ -866,7 +866,7 @@ class CoreExport Module
*/
virtual void OnDelNick(NickAlias *na) { }
- /* Called on findcore()
+ /** Called on findcore()
* @param nick nickname to be searched for (nc->display)
*/
virtual void OnFindCore(const std::string &nick) { }
@@ -908,7 +908,7 @@ class CoreExport Module
*/
virtual void OnNickEraseAccess(NickCore *nc, const std::string &entry) { }
- /** called when a HostCore is deleted
+ /** called when a HostCore is deleted
* @param hc pointer to the HostCore
*/
virtual void OnDeleteHostCore(HostCore *hc) { }
diff --git a/include/regchannel.h b/include/regchannel.h
index 416d58f74..5bb8599e4 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -12,7 +12,7 @@
class CoreExport ChannelInfo : public Extensible
{
private:
- std::map<ChannelModeName, std::string> Params;
+ std::map<ChannelModeName, std::string> Params;
public:
ChannelInfo()
diff --git a/include/services.h b/include/services.h
index f11aaffcf..109723643 100644
--- a/include/services.h
+++ b/include/services.h
@@ -463,7 +463,7 @@ enum ChannelModeName
CMODE_NOCTCP, CMODE_FILTER, CMODE_NOKNOCK, CMODE_REDIRECT, CMODE_REGMODERATED, CMODE_NONICK, CMODE_OPERONLY,
CMODE_NOKICK, CMODE_REGISTEREDONLY, CMODE_STRIPCOLOR, CMODE_NONOTICE, CMODE_NOINVITE, CMODE_ALLINVITE,
CMODE_BLOCKCAPS, CMODE_PERM,
-
+
/* b/e/I */
CMODE_BAN, CMODE_EXCEPT,
CMODE_INVITEOVERRIDE,
@@ -882,7 +882,7 @@ struct c_userlist {
UserData *ud;
};
-class CoreExport Channel
+class CoreExport Channel : public Extensible
{
private:
/** A map of channel modes with their parameters set on this channel
@@ -1253,7 +1253,7 @@ class ChannelModeParam : public ChannelMode
class ChannelModeStatus : public ChannelMode
{
public:
- /** CUS_ values, see below
+ /** CUS_ values, see below
*/
int16 Status;
/* The symbol, eg @ % + */
@@ -1404,7 +1404,7 @@ class ChannelModeAdmin : public ChannelMode
{
public:
ChannelModeAdmin() : ChannelMode(CMODE_ADMINONLY) { }
-
+
/* Opers only */
bool CanSet(User *u);
};
@@ -1416,7 +1416,7 @@ class ChannelModeOper : public ChannelMode
{
public:
ChannelModeOper() : ChannelMode(CMODE_OPERONLY) { }
-
+
/* Opers only */
bool CanSet(User *u);
};
@@ -1428,7 +1428,7 @@ class ChannelModeRegistered : public ChannelMode
{
public:
ChannelModeRegistered() : ChannelMode(CMODE_REGISTERED) { }
-
+
/* No one mlocks +r */
bool CanSet(User *u);
};
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];