Переглянути джерело

[java/cs] minor Lib renaming

Caue Waneck 13 роки тому
батько
коміт
4199bff160

+ 2 - 2
std/cs/Lib.hx

@@ -70,12 +70,12 @@ class Lib
 	@:functionBody('
 			return obj.GetType();
 	')
-	public static function getNativeType(obj:Dynamic):Type
+	public static function nativeType(obj:Dynamic):Type
 	{
 		return untyped obj.GetType();
 	}
 	
-	public static function fromNativeArray<T>(native:cs.NativeArray<T>):Array<T>
+	public static function array<T>(native:cs.NativeArray<T>):Array<T>
 	{
 		return untyped Array.ofNative(native);
 	}

+ 1 - 1
std/cs/_std/Std.hx

@@ -35,7 +35,7 @@ import cs.internal.Exceptions;
 		
 		var native:system.Type = untyped clt.nativeType();
 		
-		return native.IsAssignableFrom(Lib.getNativeType(v));
+		return native.IsAssignableFrom(Lib.nativeType(v));
 	}
 
 	public static inline function string( s : Dynamic ) : String {

+ 1 - 1
std/cs/_std/Sys.hx

@@ -56,7 +56,7 @@ class Sys {
 	{
 		if (_args == null)
 		{
-			var ret = cs.Lib.fromNativeArray(Environment.GetCommandLineArgs());
+			var ret = cs.Lib.array(Environment.GetCommandLineArgs());
 			ret.shift();
 			_args = ret;
 		}

+ 1 - 1
std/cs/_std/sys/FileSystem.hx

@@ -153,7 +153,7 @@ class FileSystem {
 			}
 		}
 		
-		return cs.Lib.fromNativeArray( ret );
+		return cs.Lib.array( ret );
 	}
 
 }

+ 2 - 2
std/cs/internal/Runtime.hx

@@ -341,7 +341,7 @@ import system.Type;
 		{
 			oargs[i] = args[i];
 			if (args[i] != null)
-				ts[i] = Lib.getNativeType(args[i]);
+				ts[i] = Lib.nativeType(args[i]);
 		}
 		
 		var last = 0;
@@ -431,7 +431,7 @@ import system.Type;
 	
 	public static function unbox(dyn:Dynamic):Dynamic
 	{
-		if (dyn != null && untyped (Lib.getNativeType(dyn) + "").StartsWith("haxe.lang.Null"))
+		if (dyn != null && untyped (Lib.nativeType(dyn) + "").StartsWith("haxe.lang.Null"))
 		{
 			return dyn.toDynamic();
 		} else {

+ 2 - 7
std/java/Lib.hx

@@ -1,11 +1,6 @@
 package java;
 import java.lang.Class;
 
-/**
- * ...
- * @author waneck
- */
-
 //we cannot use the java package for custom classes, so we're redefining it as "haxe.java.Lib"
 @:native('haxe.java.Lib') class Lib 
 {
@@ -29,12 +24,12 @@ import java.lang.Class;
 	@:functionBody('
 		return (java.lang.Class<T>) obj.getClass();
 	')
-	public static function getNativeType<T>(obj:T):java.lang.Class<T>
+	public static function nativeType<T>(obj:T):java.lang.Class<T>
 	{
 		return null;
 	}
 	
-	public static function fromNativeArray<T>(native:java.NativeArray<T>):Array<T>
+	public static function array<T>(native:java.NativeArray<T>):Array<T>
 	{
 		return untyped Array.ofNative(native);
 	}

+ 1 - 1
std/java/_std/Sys.hx

@@ -56,7 +56,7 @@ import sys.io.Process;
 	{
 		if (_args == null)
 			return [];
-		return java.Lib.fromNativeArray(_args);
+		return java.Lib.array(_args);
 	}
 
 	/**

+ 1 - 1
std/java/_std/sys/FileSystem.hx

@@ -127,7 +127,7 @@ class FileSystem {
 		var f = new File(path);
 		if (!f.exists())
 			throw "Path " + path + " doesn't exist";
-		return Lib.fromNativeArray( f.list() );
+		return Lib.array( f.list() );
 	}
 
 }