diff options
author | Peter Powell <petpow@saberuk.com> | 2017-10-19 11:55:17 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2017-10-19 14:58:21 +0100 |
commit | 3c7e105d09c99ed0b74a63bef68d5f2a1cbd8cff (patch) | |
tree | c0fc69bbcd77322a7ea2fad4bb32a5c107479041 /src | |
parent | 020c1d6ea658956e7cb2462a748790a4f4e30787 (diff) |
Switch from std::stringstream to irc::spacesepstream.
The latter is more suited to the things we have previously been
using std::stringstream for.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_conn_umodes.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_opermodes.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_shun.cpp | 4 | ||||
-rw-r--r-- | src/wildcard.cpp | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/m_conn_umodes.cpp b/src/modules/m_conn_umodes.cpp index acac7640a..c439f3bfe 100644 --- a/src/modules/m_conn_umodes.cpp +++ b/src/modules/m_conn_umodes.cpp @@ -47,13 +47,13 @@ class ModuleModesOnConnect : public Module if (!ThisModes.empty()) { std::string buf; - std::stringstream ss(ThisModes); + irc::spacesepstream ss(ThisModes); std::vector<std::string> modes; modes.push_back(user->nick); // split ThisUserModes into modes and mode params - while (ss >> buf) + while (ss.GetToken(buf)) modes.push_back(buf); ServerInstance->Parser.CallHandler("MODE", modes, user); diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp index 33ebb57a0..6a18e9c9d 100644 --- a/src/modules/m_opermodes.cpp +++ b/src/modules/m_opermodes.cpp @@ -52,12 +52,12 @@ class ModuleModesOnOper : public Module smodes = "+" + smodes; std::string buf; - std::stringstream ss(smodes); + irc::spacesepstream ss(smodes); std::vector<std::string> modes; modes.push_back(u->nick); // split into modes and mode params - while (ss >> buf) + while (ss.GetToken(buf)) modes.push_back(buf); ServerInstance->Parser.CallHandler("MODE", modes, u); diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 28faf898b..417d67b69 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -217,10 +217,10 @@ class ModuleShun : public Module ShunEnabledCommands.clear(); - std::stringstream dcmds(cmds); + irc::spacesepstream dcmds(cmds); std::string thiscmd; - while (dcmds >> thiscmd) + while (dcmds.GetToken(thiscmd)) { ShunEnabledCommands.insert(thiscmd); } diff --git a/src/wildcard.cpp b/src/wildcard.cpp index 6711f953a..4a313af76 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -109,9 +109,9 @@ bool InspIRCd::MatchCIDR(const char* str, const char* mask, unsigned const char* bool InspIRCd::MatchMask(const std::string& masks, const std::string& hostname, const std::string& ipaddr) { - std::stringstream masklist(masks); + irc::spacesepstream masklist(masks); std::string mask; - while (masklist >> mask) + while (masklist.GetToken(mask)) { if (InspIRCd::Match(hostname, mask, ascii_case_insensitive_map) || InspIRCd::MatchCIDR(ipaddr, mask, ascii_case_insensitive_map)) |