mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
GP-5640: Making more things Iterable
This commit is contained in:
parent
915760bcae
commit
71ed695edd
7 changed files with 183 additions and 16 deletions
|
@ -17,6 +17,7 @@ package ghidra.framework.model;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.framework.client.RepositoryAdapter;
|
||||
|
@ -29,7 +30,7 @@ import ghidra.framework.options.SaveState;
|
|||
* and tools to work together.
|
||||
*
|
||||
*/
|
||||
public interface Project extends AutoCloseable {
|
||||
public interface Project extends AutoCloseable, Iterable<DomainFile> {
|
||||
|
||||
/**
|
||||
* Convenience method to get the name of this project.
|
||||
|
@ -194,4 +195,9 @@ public interface Project extends AutoCloseable {
|
|||
*/
|
||||
public void removeProjectViewListener(ProjectViewListener listener);
|
||||
|
||||
@Override
|
||||
public default Iterator<DomainFile> iterator() {
|
||||
return new ProjectDataUtils.DomainFileIterator(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ package ghidra.framework.model;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.framework.client.RepositoryAdapter;
|
||||
|
@ -30,7 +31,7 @@ import ghidra.util.task.TaskMonitor;
|
|||
* The ProjectData interface provides access to all the data files and folders
|
||||
* in a project.
|
||||
*/
|
||||
public interface ProjectData {
|
||||
public interface ProjectData extends Iterable<DomainFile> {
|
||||
|
||||
/**
|
||||
* @return local storage implementation class
|
||||
|
@ -224,4 +225,8 @@ public interface ProjectData {
|
|||
*/
|
||||
public URL getLocalProjectURL();
|
||||
|
||||
@Override
|
||||
public default Iterator<DomainFile> iterator() {
|
||||
return new ProjectDataUtils.DomainFileIterator(getRootFolder());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue