/src/lib/io/basic/null_input_stream.e

http://github.com/tybor/Liberty · Specman e · 86 lines · 43 code · 15 blank · 28 comment · 0 complexity · d461af981b48b2a397fe14ab79733ec8 MD5 · raw file

  1. -- This file is part of a Liberty Eiffel library.
  2. -- See the full copyright at the end.
  3. --
  4. class NULL_INPUT_STREAM
  5. --
  6. -- This "null" stream provides an unbroken sequence of '%U'
  7. -- (like /dev/zero does on Unix)
  8. --
  9. inherit
  10. TERMINAL_INPUT_STREAM
  11. redefine
  12. filtered_read_line_in, dispose
  13. end
  14. feature {ANY}
  15. end_of_input: BOOLEAN False
  16. is_connected: BOOLEAN True
  17. can_unread_character: BOOLEAN True
  18. disconnect
  19. do
  20. filter := Void
  21. end
  22. feature {FILTER_INPUT_STREAM}
  23. filtered_read_character
  24. do
  25. end
  26. filtered_unread_character
  27. do
  28. end
  29. filtered_last_character: CHARACTER '%U'
  30. filtered_read_line_in (buffer: STRING)
  31. do
  32. end
  33. feature {FILTER}
  34. filtered_descriptor: INTEGER
  35. do
  36. std_error.put_string("NULL_INPUT_STREAM.filtered_descriptor has been called!%N")
  37. crash
  38. end
  39. filtered_has_descriptor: BOOLEAN False
  40. filtered_stream_pointer: POINTER
  41. do
  42. std_error.put_string("NULL_INPUT_STREAM.filtered_stream_pointer has been called!%N")
  43. crash
  44. end
  45. filtered_has_stream_pointer: BOOLEAN False
  46. feature {}
  47. dispose
  48. do
  49. -- No need to force people to disconnect such a STREAM.
  50. end
  51. end -- class NULL_INPUT_STREAM
  52. --
  53. -- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
  54. --
  55. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  56. -- of this software and associated documentation files (the "Software"), to deal
  57. -- in the Software without restriction, including without limitation the rights
  58. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  59. -- copies of the Software, and to permit persons to whom the Software is
  60. -- furnished to do so, subject to the following conditions:
  61. --
  62. -- The above copyright notice and this permission notice shall be included in
  63. -- all copies or substantial portions of the Software.
  64. --
  65. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  66. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  67. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  68. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  69. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  70. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  71. -- THE SOFTWARE.