mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-06 05:01:25 -07:00
Improve "split to byte array views" function
1. Utilize string matcher 2. Remove split behavior parameter Previously `KeepEmptyParts` behavior doesn't match Qt's implementation and since our codebase doesn't really make use of it, we can just remove the parameter. 3. Add tests. PR #22352.
This commit is contained in:
parent
96295adc08
commit
62a7fd86d6
9 changed files with 67 additions and 19 deletions
|
@ -37,8 +37,8 @@ class QByteArrayView;
|
|||
|
||||
namespace Utils::ByteArray
|
||||
{
|
||||
// Mimic QStringView(in).split(sep, behavior)
|
||||
QList<QByteArrayView> splitToViews(QByteArrayView in, QByteArrayView sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts);
|
||||
// Inspired by QStringView(in).split(sep, Qt::SkipEmptyParts)
|
||||
QList<QByteArrayView> splitToViews(QByteArrayView in, QByteArrayView sep);
|
||||
QByteArray asQByteArray(QByteArrayView view);
|
||||
|
||||
QByteArray toBase32(const QByteArray &in);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue