Coverage report: /development/source/library/org/datagraph/spocq-shard/src/core/encoding/writer-stream.lisp
| Kind | Covered | All | % |
| expression | 0 | 41 | 0.0 |
| branch | 0 | 2 | 0.0 |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; -*- Mode: lisp; Syntax: ansi-common-lisp; Base: 10; Package: org.datagraph.spocq.implementation; -*-
3
(in-package :org.datagraph.spocq.implementation)
5
(defClass writer-stream (#+ALLEGRO excl::fundamental-binary-output-stream
6
#+CMU extensions:fundamental-binary-output-stream
7
#+LispWorks stream:fundamental-stream
8
#+digitool ccl::output-binary-stream
10
#+clozure-common-lisp ccl:fundamental-binary-stream
11
#+sbcl sb-gray:fundamental-binary-output-stream)
13
:initform (error "stream is required.") :initarg :stream)
15
:initarg :writer-function :initform (error "encoder is required.")
16
:reader stream-writer-function)
17
#+(or clisp CMU lispworks sbcl scl clozure-common-lisp)
18
(direction :initarg :direction)
20
:initform #(#\return #\linefeed) :initarg :eol-sequence
21
:reader stream-eol-sequence))
22
(:default-initargs :direction :output
23
#+CormanLisp :element-type #+CormanLisp 'unsigned-byte)
24
(:documentation "An encoder-stream serves as a character output stream delegate to a binary stream
25
and encodes the characters through the application of a provided writer function."))
27
(defmethod stream-element-type ((stream writer-stream))
31
(defmethod open-stream-p ((stream writer-stream))
35
(defmethod stream-line-column ((stream writer-stream)) nil)
37
(defmethod stream-terpri ((stream writer-stream))
38
(let ((writer (stream-writer-function stream)))
39
(funcall writer #\return)
40
(funcall writer #\linefeed)))
42
(defmethod stream-write-char ((stream writer-stream) (char character))
43
(funcall (stream-writer-function stream) char))
45
(defmethod stream-write-string ((stream writer-stream) string
46
#-digitool &optional start end)
47
(unless end (setf end (length string)))
48
(let ((writer (stream-writer-function stream)))
49
(do ((i (or start 0) (1+ i)))
51
(funcall writer (char string i)))
55
(defmethod stream-tyo ((stream writer-stream) char)
56
(funcall (stream-writer-function stream) char))