Search in sources :

Example 1 with ZipEntryRO

use of com.badlogic.gdx.backends.android.ZipResourceFile.ZipEntryRO in project libgdx by libgdx.

the class AndroidZipFileHandle method list.

@Override
public FileHandle[] list(FileFilter filter) {
    ZipEntryRO[] zipEntries = expansionFile.getEntriesAt(getPath());
    FileHandle[] handles = new FileHandle[zipEntries.length];
    int count = 0;
    for (int i = 0, n = handles.length; i < n; i++) {
        FileHandle child = new AndroidZipFileHandle(zipEntries[i].mFileName);
        if (!filter.accept(child.file()))
            continue;
        handles[count] = child;
        count++;
    }
    if (count < zipEntries.length) {
        FileHandle[] newHandles = new FileHandle[count];
        System.arraycopy(handles, 0, newHandles, 0, count);
        handles = newHandles;
    }
    return handles;
}
Also used : FileHandle(com.badlogic.gdx.files.FileHandle) ZipEntryRO(com.badlogic.gdx.backends.android.ZipResourceFile.ZipEntryRO)

Aggregations

ZipEntryRO (com.badlogic.gdx.backends.android.ZipResourceFile.ZipEntryRO)1 FileHandle (com.badlogic.gdx.files.FileHandle)1