소스 검색

[std] fix FileOutput / FileInput constructors showing up in API docs

Jens Fischer 5 년 전
부모
커밋
eee7918b26

+ 4 - 4
std/cs/_std/sys/io/File.hx

@@ -56,7 +56,7 @@ class File {
 		#else
 		var stream = new cs.system.io.FileStream(path, Open, Read, ReadWrite);
 		#end
-		return new FileInput(stream);
+		return @:privateAccess new FileInput(stream);
 	}
 
 	public static function write(path:String, binary:Bool = true):FileOutput {
@@ -65,7 +65,7 @@ class File {
 		#else
 		var stream = new cs.system.io.FileStream(path, Create, Write, ReadWrite);
 		#end
-		return new FileOutput(stream);
+		return @:privateAccess new FileOutput(stream);
 	}
 
 	public static function append(path:String, binary:Bool = true):FileOutput {
@@ -74,7 +74,7 @@ class File {
 		#else
 		var stream = new cs.system.io.FileStream(path, Append, Write, ReadWrite);
 		#end
-		return new FileOutput(stream);
+		return @:privateAccess new FileOutput(stream);
 	}
 
 	public static function update(path:String, binary:Bool = true):FileOutput {
@@ -86,7 +86,7 @@ class File {
 		#else
 		var stream = new cs.system.io.FileStream(path, OpenOrCreate, Write, ReadWrite);
 		#end
-		return new FileOutput(stream);
+		return @:privateAccess new FileOutput(stream);
 	}
 
 	public static function copy(srcPath:String, dstPath:String):Void {

+ 1 - 1
std/cs/_std/sys/io/FileInput.hx

@@ -23,7 +23,7 @@
 package sys.io;
 
 class FileInput extends cs.io.NativeInput {
-	public function new(stream:cs.system.io.FileStream) {
+	function new(stream:cs.system.io.FileStream) {
 		super(stream);
 	}
 }

+ 1 - 1
std/cs/_std/sys/io/FileOutput.hx

@@ -23,7 +23,7 @@
 package sys.io;
 
 class FileOutput extends cs.io.NativeOutput {
-	public function new(stream:cs.system.io.FileStream) {
+	function new(stream:cs.system.io.FileStream) {
 		super(stream);
 	}
 }

+ 12 - 12
std/java/_std/sys/io/File.hx

@@ -52,9 +52,9 @@ class File {
 
 	public static function read(path:String, binary:Bool = true):FileInput {
 		try {
-			return new FileInput(new java.io.RandomAccessFile(new java.io.File(path), "r"));
-		} catch (e:Dynamic) // swallow checked exceptions
-		{
+			return @:privateAccess new FileInput(new java.io.RandomAccessFile(new java.io.File(path), "r"));
+		} catch (e:Dynamic) {
+			// swallow checked exceptions
 			throw e;
 		}
 	}
@@ -66,9 +66,9 @@ class File {
 		}
 
 		try {
-			return new FileOutput(new java.io.RandomAccessFile(f, "rw"));
-		} catch (e:Dynamic) // swallow checked exceptions
-		{
+			return @:privateAccess new FileOutput(new java.io.RandomAccessFile(f, "rw"));
+		} catch (e:Dynamic) {
+			// swallow checked exceptions
 			throw e;
 		}
 	}
@@ -81,9 +81,9 @@ class File {
 			if (f.exists()) {
 				ra.seek(f.length());
 			}
-			return new FileOutput(ra);
-		} catch (e:Dynamic) // swallow checked exceptions
-		{
+			return @:privateAccess new FileOutput(ra);
+		} catch (e:Dynamic) {
+			// swallow checked exceptions
 			throw e;
 		}
 	}
@@ -93,9 +93,9 @@ class File {
 
 		try {
 			var ra = new java.io.RandomAccessFile(f, "rw");
-			return new FileOutput(ra);
-		} catch (e:Dynamic) // swallow checked exceptions
-		{
+			return @:privateAccess new FileOutput(ra);
+		} catch (e:Dynamic) {
+			// swallow checked exceptions
 			throw e;
 		}
 	}

+ 1 - 1
std/java/_std/sys/io/FileInput.hx

@@ -33,7 +33,7 @@ class FileInput extends Input {
 	var f:java.io.RandomAccessFile;
 	var _eof:Bool;
 
-	public function new(f) {
+	function new(f) {
 		this.f = f;
 		this._eof = false;
 	}

+ 1 - 1
std/java/_std/sys/io/FileOutput.hx

@@ -31,7 +31,7 @@ import java.io.IOException;
 class FileOutput extends Output {
 	var f:java.io.RandomAccessFile;
 
-	public function new(f) {
+	function new(f) {
 		this.f = f;
 	}
 

+ 9 - 9
std/lua/_std/Sys.hx

@@ -76,8 +76,8 @@ class Sys {
 	}
 
 	public static function environment():Map<String, String> {
-        var env = lua.lib.luv.Os.environ();
-        return lua.Table.toMap(env);
+		var env = lua.lib.luv.Os.environ();
+		return lua.Table.toMap(env);
 	}
 
 	@:deprecated("Use programPath instead") public static function executablePath():String {
@@ -111,16 +111,16 @@ class Sys {
 		lua.lib.luv.Thread.sleep(Math.floor(seconds * 1000));
 
 	public inline static function stderr():haxe.io.Output
-		return new FileOutput(Io.stderr);
+		return @:privateAccess new FileOutput(Io.stderr);
 
 	public inline static function stdin():haxe.io.Input
-		return new FileInput(Io.stdin);
+		return @:privateAccess new FileInput(Io.stdin);
 
 	public inline static function stdout():haxe.io.Output
-		return new FileOutput(Io.stdout);
+		return @:privateAccess new FileOutput(Io.stdout);
 
-	public static function time():Float{
-        var stamp = lua.lib.luv.Misc.gettimeofday();
-        return stamp.seconds + (stamp.microseconds / 100000);
-    }
+	public static function time():Float {
+		var stamp = lua.lib.luv.Misc.gettimeofday();
+		return stamp.seconds + (stamp.microseconds / 100000);
+	}
 }

+ 4 - 4
std/lua/_std/sys/io/File.hx

@@ -41,14 +41,14 @@ class File {
 	}
 
 	public static function append(path:String, binary:Bool = true):FileOutput {
-		return new FileOutput(Io.open(path, "a"));
+		return @:privateAccess new FileOutput(Io.open(path, "a"));
 	}
 
 	public static function update(path:String, binary:Bool = true):FileOutput {
 		if (!FileSystem.exists(path)) {
 			write(path).close();
 		}
-		return new FileOutput(Io.open(path, binary ? "r+b" : "r+"));
+		return @:privateAccess new FileOutput(Io.open(path, binary ? "r+b" : "r+"));
 	}
 
 	public static function copy(srcPath:String, dstPath:String):Void {
@@ -73,14 +73,14 @@ class File {
 		var fh = Io.open(path, binary ? 'rb' : 'r');
 		if (fh == null)
 			throw 'Invalid path : $path';
-		return new FileInput(fh);
+		return @:privateAccess new FileInput(fh);
 	}
 
 	public static function write(path:String, binary:Bool = true):FileOutput {
 		var fh = Io.open(path, binary ? 'wb' : 'w');
 		if (fh == null)
 			throw 'Invalid path : $path';
-		return new FileOutput(fh);
+		return @:privateAccess new FileOutput(fh);
 	}
 
 	public static function saveBytes(path:String, bytes:haxe.io.Bytes):Void {

+ 1 - 1
std/lua/_std/sys/io/FileInput.hx

@@ -35,7 +35,7 @@ class FileInput extends haxe.io.Input {
 	var f:FileHandle;
 	var _eof:Bool;
 
-	public function new(f:FileHandle) {
+	function new(f:FileHandle) {
 		if (f == null)
 			throw 'Invalid filehandle : $f';
 		this.bigEndian = Boot.platformBigEndian;

+ 1 - 1
std/lua/_std/sys/io/FileOutput.hx

@@ -28,7 +28,7 @@ import haxe.io.Bytes;
 class FileOutput extends haxe.io.Output {
 	var f:FileHandle;
 
-	public function new(f:FileHandle) {
+	function new(f:FileHandle) {
 		if (f == null)
 			throw 'Invalid filehandle : $f';
 		this.f = f;

+ 1 - 1
std/python/_std/sys/io/FileInput.hx

@@ -30,7 +30,7 @@ import python.io.IFileInput;
 class FileInput extends Input {
 	var impl:IFileInput;
 
-	public function new(impl:IFileInput) {
+	function new(impl:IFileInput) {
 		this.impl = impl;
 	}
 

+ 1 - 1
std/python/_std/sys/io/FileOutput.hx

@@ -31,7 +31,7 @@ import python.io.IFileOutput;
 class FileOutput extends Output {
 	var impl:IFileOutput;
 
-	public function new(impl:IFileOutput) {
+	function new(impl:IFileOutput) {
 		this.impl = impl;
 	}
 

+ 4 - 4
std/python/io/IoTools.hx

@@ -34,19 +34,19 @@ import python.lib.io.IOBase.SeekSet;
 
 class IoTools {
 	public static function createFileInputFromText(t:TextIOBase) {
-		return new FileInput(new FileTextInput(t));
+		return @:privateAccess new FileInput(new FileTextInput(t));
 	}
 
 	public static function createFileInputFromBytes(t:RawIOBase) {
-		return new FileInput(new FileBytesInput(t));
+		return @:privateAccess new FileInput(new FileBytesInput(t));
 	}
 
 	public static function createFileOutputFromText(t:TextIOBase) {
-		return new FileOutput(new FileTextOutput(t));
+		return @:privateAccess new FileOutput(new FileTextOutput(t));
 	}
 
 	public static function createFileOutputFromBytes(t:RawIOBase) {
-		return new FileOutput(new FileBytesOutput(t));
+		return @:privateAccess new FileOutput(new FileBytesOutput(t));
 	}
 
 	public static function seekInTextMode(stream:TextIOBase, tell:Void->Int, p:Int, pos:sys.io.FileSeek) {