Coverage report: /home/ellis/comp/core/lib/dat/parquet/proto.lisp

KindCoveredAll%
expression024 0.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; proto.lisp --- Parquet Data Protocol
2
 
3
 ;; 
4
 
5
 ;;; Code:
6
 (in-package :dat/parquet)
7
 
8
 (defgeneric parquet-read (value &optional stream))
9
 (defgeneric parquet-write (value &optional stream))
10
 
11
 (defmethod parquet-write ((value (eql t)) &optional stream)
12
   "Encode a parquet boolean true value."
13
   (declare (ignore value))
14
   (write-byte 1 stream))
15
 
16
 (defmethod parquet-write ((value (eql nil)) &optional stream)
17
   "Encode a parquet boolean false value."
18
   (declare (ignore value))
19
   (write-byte 0 stream))
20
 
21
 (defmethod parquet-write ((value string) &optional stream))
22
 
23
 ;;; Encode/Decode
24
 (defun parquet-encode (value &optional stream)
25
   "Encode a Lisp value and write it to a parquet stream."
26
   (parquet-write value stream))
27
 
28
 (defun parquet-decode (string &key (start 0) end)
29
   "Convert a PARQUET string into a Lisp object."
30
   (with-input-from-string (stream string :start start :end end)
31
     (values (parquet-read stream)
32
             (file-position stream))))