瀏覽代碼

[lua] Add missing FileHandle.lines() function (#10974)

This allows to iterate over all available lines of a file handle, e.g.
```haxe
final fh = lua.Io.popen(cmd);
if (fh != null) {
  for (line in p.lines()) {
    trace(line);
  }
}
```
Sebastian Thomschke 2 年之前
父節點
當前提交
8d4485be8a
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      std/lua/FileHandle.hx

+ 1 - 0
std/lua/FileHandle.hx

@@ -29,6 +29,7 @@ import sys.io.FileInput;
 extern class FileHandle extends UserData {
 	function flush():Void;
 	function read(arg:Rest<EitherType<String, Int>>):String;
+	function lines():NativeIterator<String>;
 	function close():Void;
 
 	function write(str:String):Void;