diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 82a391d46cd..7f4e38d73ad 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -1420,6 +1420,24 @@ Qt::CaseSensitivity FilePath::caseSensitivity() const return Qt::CaseSensitive; } +/*! + * \brief Returns the separator of path components for this path. + * \returns The path separator of the path. + */ +QChar FilePath::pathComponentSeparator() const +{ + return osType() == OsTypeWindows ? u'\\' : u'/'; +} + +/*! + * \brief Returns the path list separator for the device this path belongs to. + * \returns The path list separator of the device for this path + */ +QChar FilePath::pathListSeparator() const +{ + return osType() == OsTypeWindows ? u';' : u':'; +} + /*! * \brief Recursively resolves symlinks if this is a symlink. * To resolve symlinks anywhere in the path, see canonicalPath. diff --git a/src/libs/utils/filepath.h b/src/libs/utils/filepath.h index 345362576a8..5f5a5bad7f0 100644 --- a/src/libs/utils/filepath.h +++ b/src/libs/utils/filepath.h @@ -140,6 +140,8 @@ public: [[nodiscard]] FilePath operator/(const QString &str) const; Qt::CaseSensitivity caseSensitivity() const; + QChar pathComponentSeparator() const; + QChar pathListSeparator() const; void clear(); bool isEmpty() const;