1 ;;;; class definitions for the SBCL Gray streams implementation, based on the
2 ;;;; CMU CL Gray streams implementation, based on the stream-definition-by-user
3 ;;;; proposal by David N. Gray
5 ;;;; This software is part of the SBCL system. See the README file for
8 ;;;; This software is in the public domain and is provided with absolutely no
9 ;;;; warranty. See the COPYING and CREDITS files for more information.
11 (in-package "SB-GRAY")
13 (defclass fundamental-stream
(standard-object stream
)
14 ((open-p :initform t
:accessor stream-open-p
))
16 (:documentation
"Base class for all Gray streams."))
18 ;;; Define the stream classes.
19 (defclass fundamental-input-stream
(fundamental-stream) nil
21 (:documentation
"Superclass of all Gray input streams."))
23 (defclass fundamental-output-stream
(fundamental-stream) nil
25 (:documentation
"Superclass of all Gray output streams."))
27 (defclass fundamental-character-stream
(fundamental-stream) nil
30 "Superclass of all Gray streams whose element-type is a subtype of character."))
32 (defclass fundamental-binary-stream
(fundamental-stream) nil
34 (:documentation
"Superclass of all Gray streams whose element-type
35 is a subtype of unsigned-byte or signed-byte."))
37 (defclass fundamental-character-input-stream
38 (fundamental-input-stream fundamental-character-stream
) nil
40 (:documentation
"Superclass of all Gray input streams whose element-type
41 is a subtype of character."))
43 (defclass fundamental-character-output-stream
44 (fundamental-output-stream fundamental-character-stream
) nil
46 (:documentation
"Superclass of all Gray output streams whose element-type
47 is a subtype of character."))
49 (defclass fundamental-binary-input-stream
50 (fundamental-input-stream fundamental-binary-stream
) nil
52 (:documentation
"Superclass of all Gray input streams whose element-type
53 is a subtype of unsigned-byte or signed-byte."))
55 (defclass fundamental-binary-output-stream
56 (fundamental-output-stream fundamental-binary-stream
) nil
58 (:documentation
"Superclass of all Gray output streams whose element-type
59 is a subtype of unsigned-byte or signed-byte."))
61 ;;; This is not in the Gray stream proposal, so it is left here
64 ;;; example character input and output streams
66 (defclass character-output-stream
(fundamental-character-output-stream)
67 ((lisp-stream :initarg
:lisp-stream
68 :accessor character-output-stream-lisp-stream
)))
70 (defclass character-input-stream
(fundamental-character-input-stream)
71 ((lisp-stream :initarg
:lisp-stream
72 :accessor character-input-stream-lisp-stream
)))