Sfoglia il codice sorgente

added dir() implementation

Nicolas Cannasse 6 anni fa
parent
commit
1de8f2b66f
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      hxd/fmt/pak/FileSystem.hx

+ 4 - 1
hxd/fmt/pak/FileSystem.hx

@@ -268,7 +268,10 @@ class FileSystem implements hxd.fs.FileSystem {
 	}
 
 	public function dir( path : String ) : Array<FileEntry> {
-		throw "Not Supported";
+		var f = dict.get(path);
+		if( f == null ) throw new hxd.res.NotFound(path);
+		if( !f.isDirectory ) throw path+" is not a directory";
+		return [for( s in f.subs ) s];
 	}
 
 }