PageRenderTime 26ms CodeModel.GetById 20ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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