-std::vector<string> const getVectorFromString(string const & str,
- string const & delim = ",");
-
-// the same vice versa
-string const getStringFromVector(std::vector<string> const & vec,
- string const & delim = ",");
-
-// wrapper around boost::format using one argument %1$s
-string bformat(string const & fmt, string const & arg1);
-// arguments %1$s and %2$s
-string bformat(string const & fmt, string const & arg1, string const & arg2);
-// arguments %1$s and %2$s and %3$s
-string bformat(string const & fmt, string const & arg1, string const & arg2,
- string const & arg3);
-// arguments %1$s and %2$s and %3$s and %4$s
-string bformat(string const & fmt, string const & arg1, string const & arg2,
- string const & arg3, string const & arg4);
+/// If \p keepempty is true, empty strings will be pushed to the vector as well
+/// If \p trimit is true, leading and trailing whitespace will be trimmed from
+/// all values. Note that this can affect what counts as "empty".
+/// NOTE: If you want to split a string on whitespace, then do:
+/// getVectorFromString(str, " ", false, true);
+std::vector<std::string> const getVectorFromString(std::string const & str,
+ std::string const & delim = std::string(","),
+ bool keepempty = false, bool trimit = true);
+std::vector<docstring> const getVectorFromString(docstring const & str,
+ docstring const & delim = from_ascii(","),
+ bool keepempty = false, bool trimit = true);
+
+/// the same vice versa
+std::string const getStringFromVector(std::vector<std::string> const & vec,
+ std::string const & delim = std::string(","));
+docstring const getStringFromVector(std::vector<docstring> const & vec,
+ docstring const & delim = from_ascii(","));
+
+/// Search \p search_token in \p str and return the position if it is
+/// found, else -1. The last item in \p str must be "".
+int findToken(char const * const str[], std::string const & search_token);
+
+
+/// Format a floating point number with at least 6 siginificant digits, but
+/// without scientific notation.
+/// Scientific notation would be invalid in some contexts, such as lengths for
+/// LaTeX. Simply using std::ostream with std::fixed would produce results
+/// like "1000000.000000", and precision control would not be that easy either.
+std::string formatFPNumber(double);
+
+/// Returns an URI/URL-style percent-encoded copy of the string \p in.
+/// \p ex defines a string of characters that are excluded from the transformation
+docstring to_percent_encoding(docstring const & in, docstring const & ex = docstring());
+
+/// Returns a string decoded from an URI/URL-style percent-encoded string \p in.
+std::string from_percent_encoding(std::string const & in);
+
+docstring bformat(docstring const & fmt, int arg1);
+docstring bformat(docstring const & fmt, long arg1);
+#ifdef HAVE_LONG_LONG_INT
+docstring bformat(docstring const & fmt, long long arg1);
+#endif
+docstring bformat(docstring const & fmt, unsigned int arg1);
+docstring bformat(docstring const & fmt, docstring const & arg1);
+docstring bformat(docstring const & fmt, char * arg1);
+docstring bformat(docstring const & fmt, docstring const & arg1, docstring const & arg2);
+docstring bformat(docstring const & fmt, docstring const & arg1, int arg2);
+docstring bformat(docstring const & fmt, char const * arg1, docstring const & arg2);
+docstring bformat(docstring const & fmt, int arg1, int arg2);
+docstring bformat(docstring const & fmt, docstring const & arg1, docstring const & arg2, docstring const & arg3);
+docstring bformat(docstring const & fmt, docstring const & arg1, docstring const & arg2, docstring const & arg3, docstring const & arg4);
+docstring bformat(docstring const & fmt, docstring const & arg1, docstring const & arg2, docstring const & arg3, docstring const & arg4, docstring const & arg5);
+