c0051a1faa67e1bf0fef61ed9b19c61eae7c3d75
[sbcl.git] / src / pcl / gray-streams-class.lisp
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
4
5 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; more information.
7
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.
10
11 (in-package "SB-GRAY")
12 \f
13 ;;; Bootstrap the FUNDAMENTAL-STREAM class.
14 (let ((sb-pcl::*pcl-class-boot* 'fundamental-stream))
15   (defclass fundamental-stream (standard-object stream)
16     ((open-p :initform t
17              :accessor stream-open-p))
18     #+sb-doc
19     (:documentation "the base class for all Gray streams")))
20
21 ;;; Define the stream classes.
22 (defclass fundamental-input-stream (fundamental-stream) nil
23   #+sb-doc
24   (:documentation "a superclass of all Gray input streams"))
25
26 (defclass fundamental-output-stream (fundamental-stream) nil
27   #+sb-doc
28   (:documentation "a superclass of all Gray output streams"))
29
30 (defclass fundamental-character-stream (fundamental-stream) nil
31   #+sb-doc
32   (:documentation "a superclass of all Gray streams whose element-type is a subtype of character"))
33
34 (defclass fundamental-binary-stream (fundamental-stream) nil
35   #+sb-doc
36   (:documentation "a superclass of all Gray streams whose element-type is a subtype of unsigned-byte or signed-byte"))
37
38 (defclass fundamental-character-input-stream
39     (fundamental-input-stream fundamental-character-stream) nil
40   #+sb-doc
41   (:documentation "a superclass of all Gray input streams whose element-type is a subtype of character"))
42
43 (defclass fundamental-character-output-stream
44     (fundamental-output-stream fundamental-character-stream) nil
45   #+sb-doc
46   (:documentation "a superclass of all Gray output streams whose element-type is a subtype of character"))
47
48 (defclass fundamental-binary-input-stream
49     (fundamental-input-stream fundamental-binary-stream) nil
50   #+sb-doc
51   (:documentation "a superclass of all Gray input streams whose element-type is a subtype of unsigned-byte or signed-byte"))
52
53 (defclass fundamental-binary-output-stream
54     (fundamental-output-stream fundamental-binary-stream) nil
55     #+sb-doc
56   (:documentation "a superclass of all Gray output streams whose element-type is a subtype of unsigned-byte or signed-byte"))
57 \f
58 ;;; This is not in the Gray stream proposal, so it is left here
59 ;;; as example code.
60 ;;;
61 ;;; example character input and output streams
62 #|
63 (defclass character-output-stream (fundamental-character-output-stream)
64   ((lisp-stream :initarg :lisp-stream
65                 :accessor character-output-stream-lisp-stream)))
66
67 (defclass character-input-stream (fundamental-character-input-stream)
68   ((lisp-stream :initarg :lisp-stream
69                 :accessor character-input-stream-lisp-stream)))
70 |#