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