Skip to content

Commit f84d951

Browse files
committed
Introduce TestEntryIterator.java
1 parent 7c7f56d commit f84d951

2 files changed

Lines changed: 38 additions & 5 deletions

File tree

lib/src/test/org/kiwix/test/libzim/TestArchive.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ public TestArchive(FileDescriptor fd, long offset, long size)
8585
public boolean isMultiPart() { return inner.isMultiPart(); }
8686
public boolean hasNewNamespaceScheme() { return inner.hasNewNamespaceScheme(); }
8787

88-
public EntryIterator iterByPath() { return inner.iterByPath(); }
89-
public EntryIterator iterByTitle() { return inner.iterByTitle(); }
90-
public EntryIterator iterEfficient() { return inner.iterEfficient(); }
91-
public EntryIterator findByPath(String path) { return inner.findByPath(path); }
92-
public EntryIterator findByTitle(String path) { return inner.findByTitle(path); }
88+
public TestEntryIterator iterByPath() { return new TestEntryIterator(inner.iterByPath()); }
89+
public TestEntryIterator iterByTitle() { return new TestEntryIterator(inner.iterByTitle()); }
90+
public TestEntryIterator iterEfficient() { return new TestEntryIterator(inner.iterEfficient()); }
91+
public TestEntryIterator findByPath(String path) { return new TestEntryIterator(inner.findByPath(path)); }
92+
public TestEntryIterator findByTitle(String path) { return new TestEntryIterator(inner.findByTitle(path)); }
9393

9494
public void dispose() { inner.dispose(); }
9595
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright (C) 2022 Matthieu Gautier <mgautier@kymeria.fr>
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 3 of the License, or
7+
* any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17+
* MA 02110-1301, USA.
18+
*/
19+
20+
package org.kiwix.test.libzim;
21+
22+
import java.util.Iterator;
23+
import org.kiwix.libzim.EntryIterator;
24+
25+
public class TestEntryIterator implements Iterator<TestEntry>
26+
{
27+
private EntryIterator inner;
28+
29+
public TestEntryIterator(EntryIterator _inner) { inner = _inner; }
30+
31+
public boolean hasNext() { return inner.hasNext(); }
32+
public TestEntry next() { return new TestEntry(inner.next()); }
33+
}

0 commit comments

Comments
 (0)