Ejemplo n.º 1
0
int ResourceManager::listMembers(Common::ArchiveMemberList &list) const {
	int count = 0;

	for (Common::Array<HPFArchive *>::const_iterator it = _archives.begin(); it != _archives.end(); ++it) {

		Common::ArchiveMemberList members;
		count += (*it)->listMembers(members);

		list.insert(list.end(), members.begin(), members.end());
	}

	return count;
}
Ejemplo n.º 2
0
int AndroidAssetArchive::listMembers(Common::ArchiveMemberList &member_list) const {
	if (_hasCached) {
		member_list.insert(member_list.end(), _cachedMembers.begin(), _cachedMembers.end());
		return _cachedMembers.size();
	}

	int count = 0;
	AAssetDir *dir = AAssetManager_openDir(_am, "");
	const char *file = AAssetDir_getNextFileName(dir);

	while (file) {
		member_list.push_back(getMember(file));
		++count;
		file = AAssetDir_getNextFileName(dir);
	}
	AAssetDir_close(dir);

	_cachedMembers = Common::ArchiveMemberList(member_list);
	_hasCached = true;

	return count;
}