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…
Add table
Add a link
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
Pathobject, allowing for the manipulation of path, directory exploration, directory creation, etc... And aFileobject allowing for the manipulation of the content of a file.When loading the features into the AngelScript engine, it was planned to register the
Pathobject with a special factory function : this factory function was supposed to bind theVirtualFileSystemobject to the constructor of thePathso 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 variablefileSystemallow for accessing aPaththanks to theFileSystem::getPathfunction.Pathhave been implemented with most of the required functionalities, alongsideFilewith read and write capacities. More advanced features will be implemented later, like text handling with potential encoding support or Path manipulation withwithSuffixorwithBasenamefunctions.