|
@@ -22,21 +22,22 @@
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
* DAMAGE.
|
|
* DAMAGE.
|
|
*/
|
|
*/
|
|
-package neko;
|
|
|
|
|
|
+package haxe;
|
|
|
|
|
|
|
|
+@:core_api
|
|
class Utf8 {
|
|
class Utf8 {
|
|
|
|
|
|
var __b : Void;
|
|
var __b : Void;
|
|
|
|
|
|
- public function new( ?size : Int ) {
|
|
|
|
|
|
+ public function new( ?size : Int ) : Void {
|
|
__b = utf8_buf_alloc(if( size == null ) 1 else size);
|
|
__b = utf8_buf_alloc(if( size == null ) 1 else size);
|
|
}
|
|
}
|
|
|
|
|
|
- public function addChar( c : Int ) {
|
|
|
|
|
|
+ public function addChar( c : Int ) : Void {
|
|
utf8_buf_add(__b,c);
|
|
utf8_buf_add(__b,c);
|
|
}
|
|
}
|
|
|
|
|
|
- public function toString() {
|
|
|
|
|
|
+ public function toString() : String {
|
|
return new String(utf8_buf_content(__b));
|
|
return new String(utf8_buf_content(__b));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -70,7 +71,7 @@ class Utf8 {
|
|
return new String( untyped __dollar__ssub(ret,0,i) );
|
|
return new String( untyped __dollar__ssub(ret,0,i) );
|
|
}
|
|
}
|
|
|
|
|
|
- public static function iter( s : String, chars : Int -> Void ) {
|
|
|
|
|
|
+ public static function iter( s : String, chars : Int -> Void ) : Void {
|
|
utf8_iter(untyped s.__s,chars);
|
|
utf8_iter(untyped s.__s,chars);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -94,16 +95,16 @@ class Utf8 {
|
|
return new String(utf8_sub(untyped s.__s,pos,len));
|
|
return new String(utf8_sub(untyped s.__s,pos,len));
|
|
}
|
|
}
|
|
|
|
|
|
- static var utf8_buf_alloc = Lib.load("std","utf8_buf_alloc",1);
|
|
|
|
- static var utf8_buf_add = Lib.load("std","utf8_buf_add",2);
|
|
|
|
- static var utf8_buf_content = Lib.load("std","utf8_buf_content",1);
|
|
|
|
- static var utf8_buf_length = Lib.load("std","utf8_buf_length",1);
|
|
|
|
- static var utf8_iter = Lib.load("std","utf8_iter",2);
|
|
|
|
-
|
|
|
|
- static var utf8_get = Lib.load("std","utf8_get",2);
|
|
|
|
- static var utf8_validate = Lib.load("std","utf8_validate",1);
|
|
|
|
- static var utf8_length = Lib.load("std","utf8_length",1);
|
|
|
|
- static var utf8_compare = Lib.load("std","utf8_compare",2);
|
|
|
|
- static var utf8_sub = Lib.load("std","utf8_sub",3);
|
|
|
|
|
|
+ static var utf8_buf_alloc = neko.Lib.load("std","utf8_buf_alloc",1);
|
|
|
|
+ static var utf8_buf_add = neko.Lib.load("std","utf8_buf_add",2);
|
|
|
|
+ static var utf8_buf_content = neko.Lib.load("std","utf8_buf_content",1);
|
|
|
|
+ static var utf8_buf_length = neko.Lib.load("std","utf8_buf_length",1);
|
|
|
|
+ static var utf8_iter = neko.Lib.load("std","utf8_iter",2);
|
|
|
|
+
|
|
|
|
+ static var utf8_get = neko.Lib.load("std","utf8_get",2);
|
|
|
|
+ static var utf8_validate = neko.Lib.load("std","utf8_validate",1);
|
|
|
|
+ static var utf8_length = neko.Lib.load("std","utf8_length",1);
|
|
|
|
+ static var utf8_compare = neko.Lib.load("std","utf8_compare",2);
|
|
|
|
+ static var utf8_sub = neko.Lib.load("std","utf8_sub",3);
|
|
|
|
|
|
}
|
|
}
|