Mercurial > minori
diff include/core/strings.h @ 116:254b1d2b7096
settings: add torrents page, make rss feed configurable
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Tue, 07 Nov 2023 13:52:13 -0500 |
parents | ab191e28e69d |
children | 39521c47c7a3 |
line wrap: on
line diff
--- a/include/core/strings.h Tue Nov 07 12:04:51 2023 -0500 +++ b/include/core/strings.h Tue Nov 07 13:52:13 2023 -0500 @@ -7,6 +7,7 @@ #include <cstdint> class QString; +class QByteArray; namespace Strings { @@ -32,12 +33,16 @@ std::wstring ToWstring(const QString& string); std::string ToUtf8String(const std::wstring& wstring); std::string ToUtf8String(const QString& string); +std::string ToUtf8String(const QByteArray& ba); QString ToQString(const std::string& string); QString ToQString(const std::wstring& wstring); /* arithmetic :) */ int ToInt(const std::string& str, int def = 0); +bool ToBool(const std::string& s, const bool def = false); +std::string ToUtf8String(const bool b); + uint64_t HumanReadableSizeToBytes(const std::string& str); std::string RemoveLeadingChars(std::string s, const char c);