diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2010-02-18 00:48:02 +0100 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2010-02-18 00:48:02 +0100 |
commit | fc04d4b48a0a464a9fc3570e674c17ad81c3134d (patch) | |
tree | 913424ae7ad4caa50abe1906e3862e207c3f5e88 /apt-pkg/contrib/strutl.cc | |
parent | a1af1f3b1b7700d1108ee7648bce7b9d2c2c506b (diff) | |
parent | d9dedf304b384763278f5b39aa0dc29e112185c3 (diff) |
criss-cross merge with my sid branch
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index d3d6e2739..3bbaf5f30 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1005,16 +1005,17 @@ bool TokSplitString(char Tok,char *Input,char **List, /* This can be used to split a given string up into a vector, so the propose is the same as in the method above and this one is a bit slower also, but the advantage is that we an iteratable vector */ -vector<string> ExplodeString(string const &haystack, char const &split) { - string::const_iterator start = haystack.begin(); - string::const_iterator end = start; - vector<string> exploded; - do { - for (; end != haystack.end() && *end != split; ++end); - exploded.push_back(string(start, end)); - start = end + 1; - } while (end != haystack.end() && (++end) != haystack.end()); - return exploded; +vector<string> ExplodeString(string const &haystack, char const &split) +{ + string::const_iterator start = haystack.begin(); + string::const_iterator end = start; + vector<string> exploded; + do { + for (; end != haystack.end() && *end != split; ++end); + exploded.push_back(string(start, end)); + start = end + 1; + } while (end != haystack.end() && (++end) != haystack.end()); + return exploded; } /*}}}*/ // RegexChoice - Simple regex list/list matcher /*{{{*/ |