home *** CD-ROM | disk | FTP | other *** search
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- class STD_INPUT_OUTPUT
- --
- -- To have the usefule `io' of class ANY.
- --
-
- inherit
- STD_INPUT
- undefine make, connect_to, disconnect
- end;
- STD_OUTPUT
- redefine make, connect_to, disconnect
- end;
-
- creation {ANY}
- make
-
- feature {ANY}
-
- make is
- do
- mode := "rw";
- input_stream := stdin;
- output_stream := stdout;
- end;
-
- connect_to(new_path: STRING) is
- do
- mode := "rw";
- path := new_path;
- output_stream := fopen(path,mode);
- input_stream := output_stream;
- end;
-
- disconnect is
- local
- err: INTEGER;
- do
- if input_stream /= stdin then
- err := fclose(input_stream);
- end;
- if output_stream /= stdout then
- err := fclose(output_stream);
- end;
- path := Void;
- input_stream := stdin;
- output_stream := stdout;
- end;
-
- end -- STD_INPUT_OUTPUT
-