stream.sa


Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
 
---------------------------> Sather 1.1 source file <--------------------------
-- Author: Benedict A. Gomes <gomes@samosa.ICSI.Berkeley.EDU>
-- Copyright (C) 1995, International Computer Science Institute
-- $Id: stream.sa,v 1.2 1996/04/09 10:05:57 borisv Exp $
--
-- COPYRIGHT NOTICE: This code is provided WITHOUT ANY WARRANTY
-- and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
-- LICENSE contained in the file: Sather/Doc/License of the
-- Sather distribution. The license is also available from ICSI,
-- 1947 Center St., Suite 600, Berkeley CA 94704, USA.


abstract class $OSTREAM

abstract class $OSTREAM is -- A general output stream. A first stab at streams. This -- abstraction is already useful for routines that might use a file -- or a string ( a common choice is whether a routine will write to -- stdout or to a string which may then be printed to a file). -- -- Usage: -- write_to_stream(o: $OUTSTREAM) is -- o + "this is a test"; -- end; -- Which can be invoked using: -- write_to_stream(FILE::stdout); -- or -- s: STR_STREAM := #; -- write_to_stream(s); -- write_to_stream(s); -- s.str then would have two copies of "this is a test" in it. plus(s: $STR); -- Append the string "s" to the stream plus(s: $STR): SAME; -- Append the string "s" to the stream and return self end; -- class $OUTSTREAM