summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.h
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-10-02 10:15:52 +0200
committerMichael Vogt <mvo@debian.org>2013-10-02 10:15:52 +0200
commit75cd2506ce7ea411f7a0e888310d622ad330828c (patch)
treeb6067f401a71636f0aa02c0142537f964e0fa273 /apt-pkg/contrib/strutl.h
parenta38e023c9d5a237ccae1755966adc7c0bbdb9d7e (diff)
parent2ddab3fb958518acbd26685eeeb7755106b721a3 (diff)
Merge remote-tracking branch 'origin/bugfix/dpkg-progress-multiarch' into bugfix/dpkg-progress-multiarch
Diffstat (limited to 'apt-pkg/contrib/strutl.h')
-rw-r--r--apt-pkg/contrib/strutl.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h
index 080f9f82e..b42e06491 100644
--- a/apt-pkg/contrib/strutl.h
+++ b/apt-pkg/contrib/strutl.h
@@ -17,7 +17,7 @@
#define STRUTL_H
-
+#include <limits>
#include <stdlib.h>
#include <string>
#include <cstring>
@@ -70,8 +70,23 @@ bool TokSplitString(char Tok,char *Input,char **List,
// split a given string by a char
std::vector<std::string> VectorizeString(std::string const &haystack, char const &split) __attrib_const;
-// split a given string by a string token
-std::vector<std::string> StringSplit(std::string const &input, std::string const &sep, unsigned int maxsplit=0) __attrib_const;
+/* \brief Return a vector of strings from string "input" where "sep"
+ * is used as the delimiter string.
+ *
+ * \param input The input string.
+ *
+ * \param sep The seperator to use.
+ *
+ * \param maxsplit (optional) The maximum amount of splitting that
+ * should be done .
+ *
+ * The optional "maxsplit" argument can be used to limit the splitting,
+ * if used the string is only split on maxsplit places and the last
+ * item in the vector contains the remainder string.
+ */
+std::vector<std::string> StringSplit(std::string const &input,
+ std::string const &sep,
+ unsigned int maxsplit=std::numeric_limits<unsigned int>::max()) __attrib_const;
void ioprintf(std::ostream &out,const char *format,...) __like_printf(2);
void strprintf(std::string &out,const char *format,...) __like_printf(2);