+std::string const rsplit(std::string const & a, std::string & piece, char delim);
+
+/// Escapes non ASCII chars and other problematic characters that cause
+/// problems in latex labels.
+docstring const escape(docstring const & lab);
+
+/// gives a vector of stringparts which have the delimiter delim
+std::vector<std::string> const getVectorFromString(std::string const & str,
+ std::string const & delim = std::string(","));
+std::vector<docstring> const getVectorFromString(docstring const & str,
+ docstring const & delim = from_ascii(","));
+
+// the same vice versa
+std::string const getStringFromVector(std::vector<std::string> const & vec,
+ std::string const & delim = std::string(","));
+
+/// 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);
+
+/// Convert internal line endings to line endings as expected by the OS
+docstring const externalLineEnding(docstring const & str);
+
+/// Convert line endings in any formnat to internal line endings
+docstring const internalLineEnding(docstring const & str);
+
+
+#ifdef I_AM_NOT_AFRAID_OF_HEADER_LIBRARIES
+
+#include <boost/format.hpp>
+
+template<class Arg1>
+docstring bformat(docstring const & fmt, Arg1 arg1)
+{
+ return (boost::basic_format<char_type>(fmt) % arg1).str();
+}
+
+
+template<class Arg1, class Arg2>
+docstring bformat(docstring const & fmt, Arg1 arg1, Arg2 arg2)
+{
+ return (boost::basic_format<char_type>(fmt) % arg1 % arg2).str();
+}
+
+
+template<class Arg1, class Arg2, class Arg3>
+docstring bformat(docstring const & fmt, Arg1 arg1, Arg2 arg2, Arg3 arg3)
+{
+ return (boost::basic_format<char_type>(fmt) % arg1 % arg2 % arg3).str();
+}
+
+
+template<class Arg1, class Arg2, class Arg3, class Arg4>
+docstring bformat(docstring const & fmt, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4)
+{
+ return (boost::basic_format<char_type>(fmt) % arg1 % arg2 % arg3 % arg4).str();
+}
+
+#else
+
+template <class Arg1>
+docstring bformat(docstring const & fmt, Arg1);
+
+template <class Arg1, class Arg2>
+docstring bformat(docstring const & fmt, Arg1, Arg2);
+
+template <class Arg1, class Arg2, class Arg3>
+docstring bformat(docstring const & fmt, Arg1, Arg2, Arg3);
+
+template <class Arg1, class Arg2, class Arg3, class Arg4>
+docstring bformat(docstring const & fmt, Arg1, Arg2, Arg3, Arg4);
+
+#endif
+
+} // namespace support
+} // namespace lyx