mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-04-30 06:34:27 +02:00
35 lines
601 B
C++
35 lines
601 B
C++
#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);
|
|
|
|
QString getRandomAlphaNumeric();
|
|
} // namespace StringUtils
|