IOBase.hx 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 python.lib.io;
  23. enum abstract SeekSet(Int) {
  24. var SeekSet = 0;
  25. var SeekCur = 1;
  26. var SeekEnd = 2;
  27. }
  28. @:pythonImport("io", "IOBase")
  29. extern class IOBase implements IIOBase {
  30. public function close():Void;
  31. public function flush():Void;
  32. public function readline(limit:Int = -1):String;
  33. public function readable():Bool;
  34. public var closed(default, null):Bool;
  35. public function readlines(hint:Int = -1):Array<String>;
  36. public function tell():Int;
  37. public function writable():Bool;
  38. public function seekable():Bool;
  39. public function fileno():Int;
  40. public function seek(offset:Int, whence:SeekSet):Int;
  41. public function truncate(size:Int):Int;
  42. }
  43. @:remove extern interface IIOBase {
  44. public function close():Void;
  45. public function flush():Void;
  46. public function readline(limit:Int = -1):String;
  47. public function readable():Bool;
  48. public var closed(default, null):Bool;
  49. public function readlines(hint:Int = -1):Array<String>;
  50. public function tell():Int;
  51. public function writable():Bool;
  52. public function seekable():Bool;
  53. public function fileno():Int;
  54. public function seek(offset:Int, whence:SeekSet):Int;
  55. public function truncate(size:Int):Int;
  56. }