Re-architect resource loading and filesystem utilities
Re-architect resource loading and filesystem utilities
Refactor #1436 [Closed]
Status: | Closed | |
---|---|---|
Start date: | 2012-08-20 | |
Priority: | Normal | |
Due date: | ||
Assignee: | folecr | |
% Done: | 100% |
|
Category: | - | |
Target version: | - |
The file system APIs are hard to maintain and not flexible enough for development usage.
Requirements :
* Easy switching between POSIX APIs and platform specific APIs - this allows development from POSIX filesystems and deployment on device-specific filesystems.
* This switching can be done by assigning a CCFileSystem to the framework at startup. (Default should be device filesystem, development mode access to be chosen by assigning a subclass of CCFileUtils that uses POSIX API’s)
* Optimized use of device filesystem APIs at deploy time
* Correct throwing of errors/exceptions so that script bindings are easy to write
Problems with current implementation :
* It is hard to use CCFileUtils in development mode. It is also inefficient. (Code checks for path string and behaves differently depending on existence of hardcoded strings)
* Use of popups by default instead of exceptions
Suggestions:
* Refactor so that the startup code can assigning a custom subclass of CCFileUtils to the framework in development mode
* Android CCFileUtils implementation should use Android APIs instead of custom zip/unzip