Mercurial > minori
comparison src/core/strings.cpp @ 77:6f7385bd334c
*: update
formatted all source files, no more subclassing QThread... many other
changes :)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Fri, 06 Oct 2023 06:18:53 -0400 |
parents | 3364fadc8a36 |
children |
comparison
equal
deleted
inserted
replaced
76:3364fadc8a36 | 77:6f7385bd334c |
---|---|
94 return converter.to_bytes(wstring); | 94 return converter.to_bytes(wstring); |
95 } | 95 } |
96 | 96 |
97 std::string ToUtf8String(const QString& string) { | 97 std::string ToUtf8String(const QString& string) { |
98 QByteArray ba = string.toUtf8(); | 98 QByteArray ba = string.toUtf8(); |
99 return std::string(ba.data(), ba.size()); | 99 return std::string(ba.constData(), ba.size()); |
100 } | |
101 | |
102 std::string ToUtf8String(const QByteArray& ba) { | |
103 return std::string(ba.constData(), ba.size()); | |
100 } | 104 } |
101 | 105 |
102 QString ToQString(const std::string& string) { | 106 QString ToQString(const std::string& string) { |
103 return QString::fromUtf8(string.c_str(), string.length()); | 107 return QString::fromUtf8(string.c_str(), string.length()); |
104 } | 108 } |