Ref T455, utility file functions

This commit is contained in:
Klaus Basan
2018-12-06 23:35:07 +01:00
parent 136d161bf0
commit ca3345bbe0
2 changed files with 49 additions and 0 deletions

View File

@@ -85,6 +85,18 @@ namespace BlackMisc
//! Strip file from path a/b/c.json a/b, return path
static QString stripFileFromPath(const QString &path);
//! Strip first slash part "/a/b" => "a/b", "h:/foo" => foo
static QString stripFirstSlashPart(const QString &path);
//! Strip first slash part "/a/b" => "a/b", "h:/foo" => foo
static QStringList stripFirstSlashParts(const QStringList &paths);
//! Strip leading slash or drive letter "/a/b" => "a/b" "H:/Foo" => "Foo"
static QString stripLeadingSlashOrDriveLetter(const QString &path);
//! Strip first slash part "/a/b" => "a/b", "h:/foo" => foo
static QStringList stripLeadingSlashOrDriveLetters(const QStringList &paths);
//! Last path segment a/b/c => c
static QString lastPathSegment(const QString &path);