feat: add more separation between types of std::string in StringUtils
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
ab6c7244fc
commit
dff5fea976
@ -5,15 +5,27 @@
|
|||||||
namespace StringUtils {
|
namespace StringUtils {
|
||||||
|
|
||||||
#if defined Q_OS_WIN32
|
#if defined Q_OS_WIN32
|
||||||
inline std::wstring toStdString(QString s)
|
using string = std::wstring;
|
||||||
|
|
||||||
|
inline string toStdString(QString s)
|
||||||
{
|
{
|
||||||
return s.toStdWString();
|
return s.toStdWString();
|
||||||
}
|
}
|
||||||
|
inline QString fromStdString(string s)
|
||||||
|
{
|
||||||
|
return QString::fromStdWString(s);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
inline std::string toStdString(QString s)
|
using string = std::string;
|
||||||
|
|
||||||
|
inline string toStdString(QString s)
|
||||||
{
|
{
|
||||||
return s.toStdString();
|
return s.toStdString();
|
||||||
}
|
}
|
||||||
|
inline QString fromStdString(string s)
|
||||||
|
{
|
||||||
|
return QString::fromStdString(s);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int naturalCompare(const QString& s1, const QString& s2, Qt::CaseSensitivity cs);
|
int naturalCompare(const QString& s1, const QString& s2, Qt::CaseSensitivity cs);
|
||||||
|
Loading…
Reference in New Issue
Block a user