mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:25:20 +00:00
UI: Rename StringViewList to SplitViewResult.
This commit is contained in:
parent
124b1ddd33
commit
c7f80ec537
@ -6,11 +6,11 @@
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
using StringView = QStringRef;
|
||||
using StringViewList = QVector<QStringRef>;
|
||||
using SplitViewResult = QVector<QStringRef>;
|
||||
# define toStringView(str) (QStringRef(&str))
|
||||
#else
|
||||
using StringView = QStringView;
|
||||
using StringViewList = QList<QStringView>;
|
||||
using SplitViewResult = QList<QStringView>;
|
||||
# define toStringView(str) (QStringView(str))
|
||||
#endif
|
||||
|
||||
|
@ -63,9 +63,9 @@ void TaskZoneDownloader::loadLocalFile()
|
||||
downloadFinished(success);
|
||||
}
|
||||
|
||||
StringViewList TaskZoneDownloader::parseAddresses(const QString &text, QString &checksum) const
|
||||
SplitViewResult TaskZoneDownloader::parseAddresses(const QString &text, QString &checksum) const
|
||||
{
|
||||
StringViewList list;
|
||||
SplitViewResult list;
|
||||
QCryptographicHash cryptoHash(QCryptographicHash::Sha256);
|
||||
|
||||
// Parse lines
|
||||
@ -93,7 +93,7 @@ StringViewList TaskZoneDownloader::parseAddresses(const QString &text, QString &
|
||||
return list;
|
||||
}
|
||||
|
||||
bool TaskZoneDownloader::storeAddresses(const StringViewList &list)
|
||||
bool TaskZoneDownloader::storeAddresses(const SplitViewResult &list)
|
||||
{
|
||||
Ip4Range ip4Range;
|
||||
if (!ip4Range.fromList(list, emptyNetMask(), sort())) {
|
||||
|
@ -54,9 +54,9 @@ public:
|
||||
|
||||
const QByteArray &zoneData() const { return m_zoneData; }
|
||||
|
||||
StringViewList parseAddresses(const QString &text, QString &textChecksum) const;
|
||||
SplitViewResult parseAddresses(const QString &text, QString &textChecksum) const;
|
||||
|
||||
bool storeAddresses(const StringViewList &list);
|
||||
bool storeAddresses(const SplitViewResult &list);
|
||||
bool loadAddresses();
|
||||
|
||||
bool saveAddressesAsText(const QString &filePath);
|
||||
|
@ -64,7 +64,7 @@ bool Ip4Range::fromText(const QString &text)
|
||||
return fromList(list);
|
||||
}
|
||||
|
||||
bool Ip4Range::fromList(const StringViewList &list, int emptyNetMask, bool sort)
|
||||
bool Ip4Range::fromList(const SplitViewResult &list, int emptyNetMask, bool sort)
|
||||
{
|
||||
Q_UNUSED(sort); // TODO
|
||||
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
|
||||
// Parse IPv4 ranges
|
||||
bool fromText(const QString &text);
|
||||
bool fromList(const StringViewList &list, int emptyNetMask = 32, bool sort = true);
|
||||
bool fromList(const SplitViewResult &list, int emptyNetMask = 32, bool sort = true);
|
||||
|
||||
signals:
|
||||
void errorLineNoChanged();
|
||||
|
@ -32,7 +32,7 @@ int StringUtil::lineEnd(const QString &text, int pos, int badPos)
|
||||
return (endPos != -1) ? endPos : badPos;
|
||||
}
|
||||
|
||||
StringViewList StringUtil::splitView(const QString &text, QLatin1Char sep, bool skipEmptyParts)
|
||||
SplitViewResult StringUtil::splitView(const QString &text, QLatin1Char sep, bool skipEmptyParts)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
const auto behavior = skipEmptyParts ? QString::SkipEmptyParts : QString::KeepEmptyParts;
|
||||
|
@ -15,7 +15,7 @@ public:
|
||||
static int lineStart(const QString &text, int pos, int badPos = -1);
|
||||
static int lineEnd(const QString &text, int pos, int badPos = -1);
|
||||
|
||||
static StringViewList splitView(
|
||||
static SplitViewResult splitView(
|
||||
const QString &text, QLatin1Char sep, bool skipEmptyParts = false);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user