Utils: Introduce FilePath::{root,schemeAndHost}Length(QStringView)

Intended as helpers for parentDir() to stop when cutting components.

Change-Id: I7615803743351a733d6f3cc9813e9de85973dc61
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2022-09-19 16:00:28 +02:00
parent dbbfb59ad9
commit a35a19d165
3 changed files with 112 additions and 0 deletions

View File

@@ -213,6 +213,9 @@ private:
void setPath(QStringView path);
void setFromString(const QString &filepath);
static int rootLength(const QStringView path);
static int schemeAndHostLength(const QStringView path);
[[nodiscard]] QString mapToDevicePath() const;
[[nodiscard]] QString encodedHost() const;