#include <config.h>
+#include "support/qstring_helpers.h"
+
+#include "support/debug.h"
#include "support/docstring.h"
+#include "support/qstring_helpers.h"
+#include <QRegExp>
#include <QString>
#include <QVector>
namespace lyx {
+LyXErr & operator<<(LyXErr & err, QString const & str)
+{
+ return err << fromqstr(str);
+}
+
+
QString toqstr(char const * str)
{
return QString::fromUtf8(str);
return str.isEmpty() ? std::string() : std::string(str.toUtf8());
}
+QString charFilterRegExp(QString const & filter)
+{
+ QString re = ".*";
+ for (int i = 0; i < filter.length(); ++i) {
+ QChar c = filter[i];
+ if (c.isLower())
+ re += "["+ QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
+ else
+ re += QRegExp::escape(c);
+ }
+ return re;
+}
+
+QString charFilterRegExpC(QString const & filter)
+{
+ QString re = "(";
+ for (int i = 0; i < filter.length(); ++i) {
+ QChar c = filter[i];
+ if (c.isLower())
+ re += "["+ QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
+ else
+ re += QRegExp::escape(c);
+ }
+ return re + ")";
+}
+
+
+
} // namespace lyx