Prechádzať zdrojové kódy

Documentation update (#5070)

* add/update copyright notice

* hide deprecated IMap from dox

* Lib documentation

* Single description

* Process documentation

* Update Lib.hx

* Single documentation inside conditionals
Mark Knol 9 rokov pred
rodič
commit
90a9e8895a
10 zmenil súbory, kde vykonal 95 pridanie a 32 odobranie
  1. 1 0
      std/Map.hx
  2. 3 0
      std/StdTypes.hx
  3. 31 27
      std/cpp/Lib.hx
  4. 4 0
      std/flash/Lib.hx
  5. 4 0
      std/js/Lib.hx
  6. 8 0
      std/lua/Lib.hx
  7. 5 0
      std/neko/Lib.hx
  8. 6 1
      std/php/Lib.hx
  9. 20 1
      std/python/Lib.hx
  10. 13 3
      std/sys/io/Process.hx

+ 1 - 0
std/Map.hx

@@ -165,5 +165,6 @@ abstract Map<K,V>(IMap<K,V> ) {
 	}
 }
 
+@:dox(hide)
 @:deprecated
 typedef IMap<K, V> = haxe.Constraints.IMap<K, V>;

+ 3 - 0
std/StdTypes.hx

@@ -58,6 +58,9 @@
 @:coreType @:notNull @:runtimeValue abstract Int to Float { }
 
 #if (java || cs || hl)
+/**
+	Single-precision IEEE 32bit float (4-byte).
+**/
 @:coreType @:notNull @:runtimeValue abstract Single to Float from Float {}
 #end
 

+ 31 - 27
std/cpp/Lib.hx

@@ -21,7 +21,11 @@
  */
 package cpp;
 
-
+/**
+	Platform-specific Cpp Library. Provides some platform-specific functions 
+	for the C++ target, such as conversion from Haxe types to native types 
+	and vice-versa.
+**/
 class Lib {
 
 	/**
@@ -45,15 +49,15 @@ class Lib {
 
 	public static function _loadPrime( lib : String, prim : String, signature : String, quietFail = false ) : Dynamic {
 		var factory:Callable< ConstCharStar -> Object > =
-               untyped __global__.__hxcpp_cast_get_proc_address(lib, prim + "__prime", quietFail);
-      if (factory!=null)
-      {
-         var func:Dynamic = factory.call(signature);
-         if (func==null && !quietFail)
-            throw '$prim does not have signature $signature';
-         return func;
-      }
-      return null;
+		untyped __global__.__hxcpp_cast_get_proc_address(lib, prim + "__prime", quietFail);
+		if (factory!=null)
+		{
+			var func:Dynamic = factory.call(signature);
+			if (func==null && !quietFail)
+				throw '$prim does not have signature $signature';
+			return func;
+		}
+		return null;
 	}
 
 
@@ -80,30 +84,30 @@ class Lib {
 	public static function rethrow(inExp:Dynamic) { throw inExp; }
 
 	public static function stringReference(inBytes:haxe.io.Bytes) : String
-   {
-      var result:String = "";
-      untyped __global__.__hxcpp_string_of_bytes(inBytes.b, result, 0, 0, true);
-      return result;
-   }
+	{
+		var result:String = "";
+		untyped __global__.__hxcpp_string_of_bytes(inBytes.b, result, 0, 0, true);
+		return result;
+	}
 
 	public static function pushDllSearchPath(inPath:String) : Void
-      untyped __global__.__hxcpp_push_dll_path(inPath);
+		untyped __global__.__hxcpp_push_dll_path(inPath);
 
 	public static function getDllExtension() : String
-      return untyped __global__.__hxcpp_get_dll_extension();
+		return untyped __global__.__hxcpp_get_dll_extension();
 
 	public static function getBinDirectory() : String
-      return untyped __global__.__hxcpp_get_bin_dir();
+		return untyped __global__.__hxcpp_get_bin_dir();
 
 	/**
 		Returns bytes referencing the content of a string.
-      Use with extreme caution - changing constant strings will crash.
-      Changing one string can cause others to change unexpectedly.
-      Only really safe if you are using it read-only or if it comes from stringReference above
+		Use with extreme caution - changing constant strings will crash.
+		Changing one string can cause others to change unexpectedly.
+		Only really safe if you are using it read-only or if it comes from stringReference above
 	**/
 	public inline static function bytesReference( s : String ) : haxe.io.Bytes {
-      var bytes = new haxe.io.BytesData();
-      untyped bytes.__unsafeStringReference(s);
+		var bytes = new haxe.io.BytesData();
+		untyped bytes.__unsafeStringReference(s);
 		return haxe.io.Bytes.ofData(bytes);
 	}
 
@@ -136,9 +140,9 @@ class Lib {
 		untyped __global__.__hxcpp_println(v);
 	}
 
-   public static function setFloatFormat(inFormat:String):Void
-   {
-      untyped __global__.__hxcpp_set_float_format(inFormat);
-   }
+	public static function setFloatFormat(inFormat:String):Void
+	{
+		untyped __global__.__hxcpp_set_float_format(inFormat);
+	}
 
 }

+ 4 - 0
std/flash/Lib.hx

@@ -21,6 +21,10 @@
  */
 package flash;
 
+/**
+	Platform-specific Flash Library. Provides some platform-specific 
+	functions for the Flash target.
+**/
 class Lib {
 
 	public static var current : flash.display.MovieClip;

+ 4 - 0
std/js/Lib.hx

@@ -21,6 +21,10 @@
  */
 package js;
 
+/**
+	Platform-specific JavaScript Library. Provides some platform-specific functions 
+	for the JavaScript target.
+**/
 class Lib {
 
 	/**

+ 8 - 0
std/lua/Lib.hx

@@ -24,12 +24,20 @@ import lua.Lua;
 import lua.Io;
 import lua.NativeStringTools;
 
+/**
+	Platform-specific Lua Library. Provides some platform-specific functions 
+	for the Lua target, such as conversion from Haxe types to native types 
+	and vice-versa.
+**/
 class Lib {
 
 	public static inline function println( v : Dynamic ) : Void {
 		Lua.print(Std.string(v));
 	}
 
+	/**
+		Print the specified value on the default output.
+	**/
 	public static inline function print(v:Dynamic) : Void {
 		Io.write(Std.string(v));
 		Io.flush();

+ 5 - 0
std/neko/Lib.hx

@@ -21,6 +21,11 @@
  */
 package neko;
 
+/**
+	Platform-specific Neko Library. Provides some platform-specific functions 
+	for the Neko target, such as conversion from Haxe types to native types 
+	and vice-versa.
+**/
 class Lib {
 
 	/**

+ 6 - 1
std/php/Lib.hx

@@ -21,6 +21,11 @@
  */
 package php;
 
+/**
+	Platform-specific PHP Library. Provides some platform-specific functions 
+	for the PHP target, such as conversion from Haxe types to native types 
+	and vice-versa.
+**/
 class Lib {
 	/**
 		Print the specified value on the default output.
@@ -111,7 +116,7 @@ class Lib {
 
 	/**
 	 * See the documentation for the equivalent PHP function for details on usage:
-	 * http://php.net/manual/en/function.mail.php
+	 * <http://php.net/manual/en/function.mail.php>
 	 * @param	to
 	 * @param	subject
 	 * @param	message

+ 20 - 1
std/python/Lib.hx

@@ -27,8 +27,15 @@ import python.NativeStringTools;
 
 typedef PySys = python.lib.Sys;
 
+/**
+	Platform-specific Python Library. Provides some platform-specific functions 
+	for the Python target, such as conversion from Haxe types to native types 
+	and vice-versa.
+**/
 class Lib {
-
+	/**
+		Print the specified value on the default output.
+	**/
 	public static function print(v:Dynamic):Void {
 		var str = Std.string(v);
 
@@ -36,6 +43,9 @@ class Lib {
 		PySys.stdout.flush();
 	}
 
+	/**
+		Print the specified value on the default output followed by a newline character.
+	**/
 	public static function println(v:Dynamic):Void {
 		var str = Std.string(v);
 
@@ -85,6 +95,9 @@ class Lib {
 		return new AnonObject(d);
 	}
 
+	/**
+		Return Python native iterable from Haxe iterable.
+	**/
 	public static function toPythonIterable <T>(it:Iterable<T>):python.NativeIterable<T> {
 		return {
 			__iter__ : function () {
@@ -105,10 +118,16 @@ class Lib {
 		}
 	}
 
+	/**
+		Return Haxe iterable from Python native iterable.
+	**/
 	public static inline function toHaxeIterable <T>(it:NativeIterable<T>):HaxeIterable<T> {
 		return new HaxeIterable(it);
 	}
 
+	/**
+		Return Haxe iterator instance from Python native iterable.
+	**/
 	public static inline function toHaxeIterator <T>(it:NativeIterator<T>):HaxeIterator<T> {
 		return new HaxeIterator(it);
 	}

+ 13 - 3
std/sys/io/Process.hx

@@ -22,10 +22,20 @@
 package sys.io;
 
 extern class Process {
+	/**
+		Standard output. The output stream where a process writes its output data.
+	**/
+	var stdout(default, null) : haxe.io.Input;
+
+	/**
+		Standard error. The output stream to output error messages or diagnostics.
+	**/
+	var stderr(default, null) : haxe.io.Input;
 
-	var stdout(default,null) : haxe.io.Input;
-	var stderr(default,null) : haxe.io.Input;
-	var stdin(default,null) : haxe.io.Output;
+	/**
+		Standard input. The stream data going into a process.
+	**/
+	var stdin(default, null) : haxe.io.Output;
 
 	/**
 		Construct a `Process` object, which run the given command immediately.