]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/hashcomp.cpp
Add $ModDep: special comment, similar to $CompileFlags and $LinkerFlags.
[user/henk/code/inspircd.git] / src / hashcomp.cpp
index 4dd9050b4c1b9a65b4fa0cefa9dd7e7b08810cd2..e004940410c6860dd4531ce3c1f49d785cc76219 100644 (file)
@@ -217,6 +217,11 @@ const std::string irc::tokenstream::GetToken()
 
        while (n != tokens.end())
        {
+               /** Skip multi space, converting "  " into " "
+                */
+               while ((n+1 != tokens.end()) && (*n == ' ') && (*(n+1) == ' '))
+                       n++;
+
                if ((last_pushed) && (*n == ':'))
                {
                        /* If we find a token thats not the first and starts with :,
@@ -338,6 +343,7 @@ void irc::modestacker::PushMinus()
 
 int irc::modestacker::GetStackedLine(std::deque<std::string> &result)
 {
+       int n = 0;
        result.clear();
        result.push_back(adding ? "+" : "-");
 
@@ -348,8 +354,35 @@ int irc::modestacker::GetStackedLine(std::deque<std::string> &result)
                        result.push_back(sequence[1]);
                sequence[0].erase(sequence[0].begin());
                sequence.erase(sequence.begin() + 1);
+               n++;
        }
 
-       return result.size();
+       return n;
+}
+
+irc::stringjoiner::stringjoiner(const std::string &seperator, const std::vector<std::string> &sequence, int begin, int end)
+{
+       for (int v = begin; v < end; v++)
+               joined.append(sequence[v]).append(seperator);
+       joined.append(sequence[end]);
+}
+
+irc::stringjoiner::stringjoiner(const std::string &seperator, const std::deque<std::string> &sequence, int begin, int end)
+{
+       for (int v = begin; v < end; v++)
+               joined.append(sequence[v]).append(seperator);
+       joined.append(sequence[end]);
+}
+
+irc::stringjoiner::stringjoiner(const std::string &seperator, const char** sequence, int begin, int end)
+{
+       for (int v = begin; v < end; v++)
+               joined.append(sequence[v]).append(seperator);
+       joined.append(sequence[end]);
+}
+
+std::string& irc::stringjoiner::GetJoined()
+{
+       return joined;
 }