aboutsummaryrefslogtreecommitdiff
path: root/launcher/StringUtils.h
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-11-10 14:34:15 +0100
committerGitHub <noreply@github.com>2022-11-10 14:34:15 +0100
commit392452d422be517b82fd4cc35087b44df16fc3f7 (patch)
tree2696a095e889a6bab49de4dc95f78ce81c7e97a6 /launcher/StringUtils.h
parente6d057fe6da1209b85af2e8385a5c1251af7e8d4 (diff)
parent9ad6eb11a37815f7aab89163184d519a2183f4f2 (diff)
downloadPrismLauncher-392452d422be517b82fd4cc35087b44df16fc3f7.tar.gz
PrismLauncher-392452d422be517b82fd4cc35087b44df16fc3f7.tar.bz2
PrismLauncher-392452d422be517b82fd4cc35087b44df16fc3f7.zip
Merge pull request #397 from flowln/windows_mod_updater_fixes_maybe
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/226
Diffstat (limited to 'launcher/StringUtils.h')
-rw-r--r--launcher/StringUtils.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/launcher/StringUtils.h b/launcher/StringUtils.h
new file mode 100644
index 00000000..1799605b
--- /dev/null
+++ b/launcher/StringUtils.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <QString>
+
+namespace StringUtils {
+
+#if defined Q_OS_WIN32
+using string = std::wstring;
+
+inline string toStdString(QString s)
+{
+ return s.toStdWString();
+}
+inline QString fromStdString(string s)
+{
+ return QString::fromStdWString(s);
+}
+#else
+using string = std::string;
+
+inline string toStdString(QString s)
+{
+ return s.toStdString();
+}
+inline QString fromStdString(string s)
+{
+ return QString::fromStdString(s);
+}
+#endif
+
+int naturalCompare(const QString& s1, const QString& s2, Qt::CaseSensitivity cs);
+} // namespace StringUtils