oryol icon indicating copy to clipboard operation
oryol copied to clipboard

file locations and platform specific directories

Open neshume opened this issue 8 years ago • 2 comments

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

neshume avatar Mar 09 '17 16:03 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? :)

floooh avatar Mar 09 '17 17:03 floooh

my thoughts exactly .. just wanted to make sure i have not missed any existing code already.

thx -neshume

neshume avatar Mar 09 '17 18:03 neshume