]> git.tdb.fi Git - libs/core.git/commitdiff
Remove some dead functions
authorMikko Rasa <tdb@tdb.fi>
Wed, 25 May 2011 07:01:22 +0000 (10:01 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 25 May 2011 07:01:22 +0000 (10:01 +0300)
source/utils.cpp

index 675a2b1094b44f05d44b8cdb3e25cd732b2f72a0..5a6bccdaca381e9e4cd066e2c0962489c4c457d1 100644 (file)
@@ -127,48 +127,6 @@ vector<string> split_fields(const string &str, char sep, int max_split)
        return split_fields(str, string(1, sep), max_split);
 }
 
-/**
-Splits a string to parts.
-
-@param   str          String to be split
-@param   sep          A set of separator characters
-@param   allow_empty  Whether or not to produce empty parts for sequences of
-                      more than one separator character
-*/
-vector<string> split(const string &str, const string &sep, bool allow_empty)
-{
-       vector<string> result;
-       
-       string::size_type start=0;
-       if(!allow_empty)
-               start=str.find_first_not_of(sep);
-       
-       while(start<str.size())
-       {
-               string::size_type end=str.find_first_of(sep, start);
-               result.push_back(str.substr(start, end-start));
-               
-               if(end==string::npos)
-                       break;
-               
-               if(allow_empty)
-               {
-                       start=end+1;
-                       if(start==str.size())
-                               result.push_back(string());
-               }
-               else
-                       start=str.find_first_not_of(sep, end);
-       }
-
-       return result;
-}
-
-vector<string> split(const string &str, char sep, bool allow_empty)
-{
-       return split(str, string(1, sep), allow_empty);
-}
-
 string strip(const string &s)
 {
        string result=s;