NativeSys.hx 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * Copyright (C)2005-2019 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. package cpp;
  23. @:buildXml('<include name="${HXCPP}/src/hx/libs/std/Build.xml"/>')
  24. extern class NativeSys {
  25. @:native("__hxcpp_print")
  26. static function print(v:Dynamic):Void;
  27. @:native("__hxcpp_println")
  28. static function println(v:Dynamic):Void;
  29. @:native("_hx_std_get_env")
  30. extern static function get_env(v:String):String;
  31. @:native("_hx_std_put_env")
  32. extern static function put_env(e:String, v:String):Void;
  33. @:native("_hx_std_sys_sleep")
  34. extern static function sys_sleep(f:Float):Void;
  35. @:native("_hx_std_set_time_locale")
  36. extern static function set_time_locale(l:String):Bool;
  37. @:native("_hx_std_get_cwd")
  38. extern static function get_cwd():String;
  39. @:native("_hx_std_set_cwd")
  40. extern static function set_cwd(d:String):Void;
  41. @:native("_hx_std_sys_string")
  42. extern static function sys_string():String;
  43. @:native("_hx_std_sys_is64")
  44. extern static function sys_is64():Bool;
  45. @:native("_hx_std_sys_command")
  46. extern static function sys_command(cmd:String):Int;
  47. @:native("_hx_std_sys_exit")
  48. extern static function sys_exit(code:Int):Void;
  49. @:native("_hx_std_sys_exists")
  50. extern static function sys_exists(path:String):Bool;
  51. @:native("_hx_std_file_delete")
  52. extern static function file_delete(path:String):Void;
  53. @:native("_hx_std_sys_rename")
  54. extern static function sys_rename(path:String, newname:String):Bool;
  55. @:native("_hx_std_sys_stat")
  56. extern static function sys_stat(path:String):Dynamic;
  57. @:native("_hx_std_sys_file_type")
  58. extern static function sys_file_type(path:String):String;
  59. @:native("_hx_std_sys_create_dir")
  60. extern static function sys_create_dir(path:String, mode:Int):Bool;
  61. @:native("_hx_std_sys_remove_dir")
  62. extern static function sys_remove_dir(path:String):Void;
  63. @:native("_hx_std_sys_time")
  64. extern static function sys_time():Float;
  65. @:native("_hx_std_sys_cpu_time")
  66. extern static function sys_cpu_time():Float;
  67. @:native("_hx_std_sys_read_dir")
  68. extern static function sys_read_dir(p:String):Array<String>;
  69. @:native("_hx_std_file_full_path")
  70. extern static function file_full_path(path:String):String;
  71. @:native("_hx_std_sys_exe_path")
  72. extern static function sys_exe_path():String;
  73. @:native("_hx_std_sys_env")
  74. extern static function sys_env():Array<String>;
  75. @:native("_hx_std_sys_getch")
  76. extern static function sys_getch(b:Bool):Int;
  77. @:native("_hx_std_sys_get_pid")
  78. extern static function sys_get_pid():Int;
  79. }