#include <vector>
-#include "Lsstream.h"
-
#include "LString.h"
+namespace lyx {
+namespace support {
+
///
int compare_no_case(string const & s, string const & s2);
///
string const uppercase(string const &);
-/// convert \a T to string
-template<typename T>
-inline
-string const tostr(T const & t)
-{
- ostringstream ostr;
- ostr << t;
- return STRCONV(ostr.str());
- // We need to use the .c_str since we sometimes are using
- // our own string class and that is not compatible with
- // basic_string<char>. (of course we don't want this later)
-}
-
-
-///
-template<>
-inline
-string const tostr(bool const & b)
-{
- return (b ? "true" : "false");
-}
-
-///
-template<>
-inline
-string const tostr(string const & s)
-{
- return s;
-}
-
-/// Does the string start with this prefix?
-bool prefixIs(string const &, char const *);
-
/// Does the string start with this prefix?
bool prefixIs(string const &, string const &);
/// Does the string end with this char?
bool suffixIs(string const &, char);
-/// Does the string end with this suffix?
-bool suffixIs(string const &, char const *);
-
/// Does the string end with this suffix?
bool suffixIs(string const &, string const &);
/// Substitute all \a oldchar with \a newchar
string const subst(string const & a, char oldchar, char newchar);
-/// Substitutes all instances of \a oldstr with \a newstr
-string const subst(string const & a,
- char const * oldstr, string const & newstr);
-
/// substitutes all instances of \a oldstr with \a newstr
string const subst(string const & a,
string const & oldstr, string const & newstr);
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);
+
+} // namespace support
+} // namespace lyx
+
#endif