SPRAAK
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Fields | Protected Member Functions
SprStreamCoder Class Reference
+ Inheritance diagram for SprStreamCoder:
+ Collaboration diagram for SprStreamCoder:

Data Fields

base::< SprStreambase
 
base::< SprStream > * fdc
 
off_t pos
 
uintptr_t aux_buf [(SPR_STREAM_BUF_SZ+SPR_STREAM_UNGET_SZ+sizeof(uintptr_t)-1)/sizeof(uintptr_t)]
 
SprCoderCommon coder
 
- Data Fields inherited from SprStream
base::< SprObjectinterface_
 
const uint8_t *restrict buf_rptr
 
uint8_t *restrict buf_wptr
 
const uint8_t *spr_readonly buf_end
 
unsigned int buf_size
 
spr_readonly int err
 
spr_readonly int eof
 
SprKeySetkeys
 
const char * fname
 

Protected Member Functions

virtual const uint8_t * buf_fill (public:SprStreamCoder *restrict fd, int min_fill)
 
virtual uint8_t * buf_flush (public:SprStreamCoder *restrict fd)
 
virtual int switch2read (SprStreamCoder *restrict fd)
 
virtual int switch2write (SprStreamCoder *restrict fd)
 
virtual off_t seek (SprStreamCoder *restrict fd, off_t offset, int mode)
 
virtual off_t tell (SprStreamCoder *restrict fd)
 
- Protected Member Functions inherited from SprStream
virtual const uint8_t * buf_fill (public:SprStream *restrict fd, int min_fill)
 
virtual uint8_t * buf_flush (public:SprStream *restrict fd)
 
virtual size_t ebuf_read (public:SprStream *restrict fd, void *restrict buf, size_t size)
 
virtual int ebuf_write (public:SprStream *restrict fd, const void *restrict buf, size_t size)
 
virtual size_t read (SprStream *restrict fd, void *restrict buf, size_t size)
 
virtual int write (SprStream *restrict fd, const void *restrict buf, size_t size)
 
virtual size_t skip (SprStream *restrict fd, size_t size)
 
virtual int fill (SprStream *restrict fd, int chr, size_t size)
 
virtual int switch2read (SprStream *restrict fd)
 
virtual int switch2write (SprStream *restrict fd)
 
virtual off_t seek (SprStream *restrict fd, off_t offset, int mode)
 
virtual off_t tell (SprStream *restrict fd)
 
virtual int align (SprStream *restrict fd)
 

Additional Inherited Members

- Protected Attributes inherited from SprStream
uint8_t * buf_start
 
unsigned int flags
 
int mode
 
size_t rdim2
 
SprStream_buf_fill buf_fill
 
SprStream_buf_flush buf_flush
 
SprStream_ebuf_read ebuf_read
 
SprStream_ebuf_write ebuf_write
 

Detailed Description

A stream object that provides transparent encodiing or decoding using one of the supported (en/de)coders (e.g. the SPHERE shorten decoder).

Bug:

Backward seeks are extremely slow.

A stream cannot be opened for both reading and writing.

Only shorten decoding is supported right now.

Member Function Documentation

virtual const uint8_t* SprStreamCoder::buf_fill ( public:SprStreamCoder *restrict  fd,
int  min_fill 
)
protectedvirtual
virtual uint8_t* SprStreamCoder::buf_flush ( public:SprStreamCoder *restrict  fd)
protectedvirtual
virtual int SprStreamCoder::switch2read ( SprStreamCoder *restrict  fd)
protectedvirtual
virtual int SprStreamCoder::switch2write ( SprStreamCoder *restrict  fd)
protectedvirtual
virtual off_t SprStreamCoder::seek ( SprStreamCoder *restrict  fd,
off_t  offset,
int  mode 
)
protectedvirtual
virtual off_t SprStreamCoder::tell ( SprStreamCoder *restrict  fd)
protectedvirtual

Field Documentation

base::<SprStream> SprStreamCoder::base
base::<SprStream> * SprStreamCoder::fdc

The stream where the encoded data comes from / goes to

off_t SprStreamCoder::pos

file position

uintptr_t SprStreamCoder::aux_buf[(SPR_STREAM_BUF_SZ+SPR_STREAM_UNGET_SZ+sizeof(uintptr_t)-1)/sizeof(uintptr_t)]
SprCoderCommon SprStreamCoder::coder

Common header. There will be more data following this common header, the amount of data (and it content) is coder specific.