Implement File System Features Into the Script Language #6
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#2 Implement the Core}
Atlas/Atlas-Launcher
Reference: Atlas/Atlas-Launcher#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
File System implementation in the Script Language
The script language shall be able to access the virtual file system thanks to a
Path
object, allowing for the manipulation of path, directory exploration, directory creation, etc... And aFile
object allowing for the manipulation of the content of a file.When loading the features into the AngelScript engine, it was planned to register the
Path
object with a special factory function : this factory function was supposed to bind theVirtualFileSystem
object to the constructor of thePath
so that it can directly be used likePath("file.txt")
. Sadly, doing so require a capturing lambda function (std::bind work the same way), which cannot be converted into a function pointer, which AngelScript use internally.A new type,
FileSystem
, have been created for this occasion. It cannot be instantiated, but a global variablefileSystem
allow for accessing aPath
thanks to theFileSystem::getPath
function.Path
have been implemented with most of the required functionalities, alongsideFile
with read and write capacities. More advanced features will be implemented later, like text handling with potential encoding support or Path manipulation withwithSuffix
orwithBasename
functions.