mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-24 22:22:21 +00:00
Android assets improvements to support directories
- Extend NSBundle resources support to handle directories in Android assets. - Fix NSFileManager -isReadableFileAtPath: to also support directories in Android assets.
This commit is contained in:
parent
4dd9fa30ab
commit
db19fc3308
3 changed files with 35 additions and 3 deletions
|
@ -1806,8 +1806,8 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
#ifdef __ANDROID__
|
||||
/* Android: try using asset manager if path is in
|
||||
* main bundle resources
|
||||
*/
|
||||
* main bundle resources
|
||||
*/
|
||||
AAsset *asset = [NSBundle assetForPath: path];
|
||||
if (asset)
|
||||
{
|
||||
|
@ -1877,13 +1877,22 @@ static NSStringEncoding defaultEncoding;
|
|||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
// Android: try using asset manager if path is in main bundle resources
|
||||
/* Android: try using asset manager if path is in
|
||||
* main bundle resources
|
||||
*/
|
||||
AAsset *asset = [NSBundle assetForPath: path];
|
||||
if (asset)
|
||||
{
|
||||
AAsset_close(asset);
|
||||
return YES;
|
||||
}
|
||||
|
||||
AAssetDir *assetDir = [NSBundle assetDirForPath: path];
|
||||
if (assetDir)
|
||||
{
|
||||
AAssetDir_close(assetDir);
|
||||
return YES;
|
||||
}
|
||||
#endif
|
||||
|
||||
return NO;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue