Browse Source

added dir() implementation

Nicolas Cannasse 6 năm trước cách đây
mục cha
commit
1de8f2b66f
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  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];
 	}
 
 }