| 200 | } |
| 201 | |
| 202 | Status AssetManagerFileSystem::GetFileSize(const string& fname, uint64* s) { |
| 203 | // If fname corresponds to a directory, return early. It doesn't map to an |
| 204 | // AAsset, and would otherwise return NotFound. |
| 205 | if (DirectoryExists(fname)) { |
| 206 | *s = 0; |
| 207 | return Status::OK(); |
| 208 | } |
| 209 | string path = RemoveAssetPrefix(fname); |
| 210 | auto asset = ScopedAsset( |
| 211 | AAssetManager_open(asset_manager_, path.c_str(), AASSET_MODE_RANDOM)); |
| 212 | if (asset.get() == nullptr) { |
| 213 | return errors::NotFound("File ", fname, " not found."); |
| 214 | } |
| 215 | *s = AAsset_getLength64(asset.get()); |
| 216 | return Status::OK(); |
| 217 | } |
| 218 | |
| 219 | Status AssetManagerFileSystem::Stat(const string& fname, FileStatistics* stat) { |
| 220 | uint64 size; |
nothing calls this directly
no test coverage detected