Selaa lähdekoodia

rename Bytes.readString to getString, keep @:deprecated readString

Simon Krajewski 11 vuotta sitten
vanhempi
commit
6cbb05b245
1 muutettua tiedostoa jossa 9 lisäystä ja 2 poistoa
  1. 9 2
      std/haxe/io/Bytes.hx

+ 9 - 2
std/haxe/io/Bytes.hx

@@ -200,7 +200,7 @@ class Bytes {
 		return b.readFloat();
 		#end
 	}
-	
+
 	public function setDouble( pos : Int, v : Float ) : Void {
 		#if neko
 		untyped $sblit(b, pos, Output._double_bytes(v,false), 0, 8);
@@ -223,7 +223,7 @@ class Bytes {
 		#end
 	}
 
-	public function readString( pos : Int, len : Int ) : String {
+	public function getString( pos : Int, len : Int ) : String {
 		#if !neko
 		if( pos < 0 || len < 0 || pos + len > length ) throw Error.OutsideBounds;
 		#end
@@ -274,6 +274,13 @@ class Bytes {
 		#end
 	}
 
+	@:deprecated("readString is deprecated, use getString instead")
+	@:noCompletion
+	// TODO: add inline if/when issue #2837 is resolved
+	public /*inline*/ function readString(pos:Int, len:Int):String {
+		return getString(pos, len);
+	}
+
 	public function toString() : String {
 		#if neko
 		return new String(untyped __dollar__ssub(b,0,length));