file locations and platform specific directories
Hi All,
sometimes one needs to get to a specific directory on a file system :
- on IOS we have NSLibraryDirectory or NSTemporaryDirectory
- on android the assets directory
I did not see localFS is dealing with this kind of specific data ..
should it be on the ios/bridge ? android/bridge?
Cheers,
-neshume
I think it should definitely go into platform-specific files under LocalFS, similar to the 'posix' directory. For a 'clean' solution there would be an androidFSWrapper and an iosFSWrapper (they could derive from posixFSWrapper and just override a new method called 'initAssigns()'.
This new FSWrapper::initAssigns() method would allow each platform to setup their own filesystem locations, abstracted through assigns (for instance a "temp:" assign which would point to a platform specific temp directory).
The LocalFileSystem::init() method would then call this general FSWrapper::initAssigns() instead of the current calls to getExecutableDir() and getCwd() here:
https://github.com/floooh/oryol/blob/master/code/Modules/LocalFS/LocalFileSystem.cc#L21
Does that make sense? :)
my thoughts exactly .. just wanted to make sure i have not missed any existing code already.
thx -neshume