Lua: Add FilePath::(complete)Suffix and isAbsolute

Change-Id: Ifc9cc97b5c996a2bee8cd15d158411306dc3bd7d
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-05-07 14:00:59 +02:00
parent 657ce51467
commit 9907c328f7
2 changed files with 17 additions and 0 deletions

View File

@@ -119,6 +119,12 @@ void addUtilsModule()
&FilePath::currentWorkingPath, &FilePath::currentWorkingPath,
"parentDir", "parentDir",
&FilePath::parentDir, &FilePath::parentDir,
"suffix",
&FilePath::suffix,
"completeSuffix",
&FilePath::completeSuffix,
"isAbsolutePath",
&FilePath::isAbsolutePath,
"resolvePath", "resolvePath",
sol::overload( sol::overload(
[](const FilePath &p, const QString &path) { return p.resolvePath(path); }, [](const FilePath &p, const QString &path) { return p.resolvePath(path); },

View File

@@ -70,4 +70,15 @@ function utils.FilePath:parentDir() end
---@return FilePath The resolved path ---@return FilePath The resolved path
function utils.FilePath:resolveSymlinks() end function utils.FilePath:resolveSymlinks() end
---Returns the suffix of the path (e.g. "test.ui.qml" -> ".qml")
---@return string
function utils.FilePath:suffix() end
---Returns the complete suffix of the path (e.g. "test.ui.qml" -> "ui.qml")
---@return string
function utils.FilePath:completeSuffix() end
---Returns whether the path is absolute
---@return boolean
function utils.FilePath:isAbsolutePath() end
return utils return utils