/src/lib/io/basic/null_output_stream.e

http://github.com/tybor/Liberty · Specman e · 76 lines · 37 code · 11 blank · 28 comment · 0 complexity · 32ae4ed256a98c0cc9effea20d5aba8c 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_OUTPUT_STREAM
  5. --
  6. -- This "null" output just swallows any character
  7. -- (like /dev/null does on Unix)
  8. --
  9. inherit
  10. TERMINAL_OUTPUT_STREAM
  11. redefine
  12. dispose
  13. end
  14. feature {ANY}
  15. is_connected: BOOLEAN True
  16. disconnect
  17. do
  18. filter := Void
  19. end
  20. feature {FILTER_OUTPUT_STREAM}
  21. filtered_put_character (c: CHARACTER)
  22. do
  23. end
  24. filtered_flush
  25. do
  26. end
  27. feature {FILTER}
  28. filtered_descriptor: INTEGER
  29. do
  30. std_error.put_string("NULL_OUTPUT_STREAM.filtered_descriptor has been called!%N")
  31. crash
  32. end
  33. filtered_has_descriptor: BOOLEAN False
  34. filtered_stream_pointer: POINTER
  35. do
  36. std_error.put_string("NULL_INPUT_STREAM.filtered_stream_pointer has been called!%N")
  37. crash
  38. end
  39. filtered_has_stream_pointer: BOOLEAN False
  40. feature {}
  41. dispose
  42. do
  43. -- No need to force people to disconnect such a STREAM.
  44. end
  45. end -- class NULL_OUTPUT_STREAM
  46. --
  47. -- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
  48. --
  49. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  50. -- of this software and associated documentation files (the "Software"), to deal
  51. -- in the Software without restriction, including without limitation the rights
  52. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  53. -- copies of the Software, and to permit persons to whom the Software is
  54. -- furnished to do so, subject to the following conditions:
  55. --
  56. -- The above copyright notice and this permission notice shall be included in
  57. -- all copies or substantial portions of the Software.
  58. --
  59. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  60. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  61. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  62. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  63. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  64. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  65. -- THE SOFTWARE.