}
+bool isEuropeanNumberSeparator(char_type c)
+{
+ if (!is_utf16(c))
+ // assume that no non-utf16 character is a numeral
+ // c outside the UCS4 range is catched as well
+ return false;
+ return ucs4_to_qchar(c).direction() == QChar::DirES;
+}
+
+
+bool isEuropeanNumberTerminator(char_type c)
+{
+ if (!is_utf16(c))
+ // assume that no non-utf16 character is a numeral
+ // c outside the UCS4 range is catched as well
+ return false;
+ return ucs4_to_qchar(c).direction() == QChar::DirET;
+}
+
+
bool isDigitASCII(char_type c)
{
return '0' <= c && c <= '9';
}
+docstring to_percent_encoding(docstring const & in, docstring const & ex)
+{
+ QByteArray input = toqstr(in).toUtf8();
+ QByteArray excludes = toqstr(ex).toUtf8();
+ return qstring_to_ucs4(QString(input.toPercentEncoding(excludes)));
+}
+
+
docstring bformat(docstring const & fmt, int arg1)
{
LATTEST(contains(fmt, from_ascii("%1$d")));
}
-#ifdef LYX_USE_LONG_LONG
+#ifdef HAVE_LONG_LONG_INT
docstring bformat(docstring const & fmt, long long arg1)
{
LATTEST(contains(fmt, from_ascii("%1$d")));
return subst(str, from_ascii("%%"), from_ascii("%"));
}
+docstring bformat(docstring const & fmt, docstring const & arg1,
+ docstring const & arg2, docstring const & arg3,
+ docstring const & arg4, docstring const & arg5)
+{
+ LATTEST(contains(fmt, from_ascii("%1$s")));
+ LATTEST(contains(fmt, from_ascii("%2$s")));
+ LATTEST(contains(fmt, from_ascii("%3$s")));
+ LATTEST(contains(fmt, from_ascii("%4$s")));
+ LATTEST(contains(fmt, from_ascii("%5$s")));
+ docstring str = subst(fmt, from_ascii("%1$s"), arg1);
+ str = subst(str, from_ascii("%2$s"), arg2);
+ str = subst(str, from_ascii("%3$s"), arg3);
+ str = subst(str, from_ascii("%4$s"), arg4);
+ str = subst(str, from_ascii("%5$s"), arg5);
+ return subst(str, from_ascii("%%"), from_ascii("%"));
+}
+
} // namespace support
} // namespace lyx