WvStreams
WvTypedEncoder< IT, unsigned char, S > Class Template Referenceabstract

Partial template specialization for unsigned char output buffer type to avoid compilation errors. More...

#include <wvtypedencoder.h>

Inheritance diagram for WvTypedEncoder< IT, unsigned char, S >:

Public Types

typedef IT IType
typedef unsigned char OType
typedef WvBufBase< IType > IBuffer
typedef WvBufBase< OType > OBuffer
typedef WvBufViewBase< IType > IBufferView
typedef WvBufViewBase< OType > OBufferView
typedef IT IType
typedef unsigned char OType
typedef WvBufBase< IType > IBuffer
typedef WvBufBase< OType > OBuffer
typedef WvBufViewBase< IType > IBufferView
typedef WvBufViewBase< OType > OBufferView

Public Member Functions

bool encode (IBuffer &inbuf, OBuffer &outbuf, bool flush=false, bool finish=false)
 Typed variant of encode().
bool flush (IBuffer &inbuf, OBuffer &outbuf, bool finish=false)
 Typed variant of flush().
bool encode (WvBuf &inbuf, WvBuf &outbuf, bool flush=false, bool finish=false)
bool flush (WvBuf &inbuf, WvBuf &outbuf, bool finish=false)
bool encode (IBuffer &inbuf, OBuffer &outbuf, bool flush=false, bool finish=false)
 Typed variant of encode().
bool flush (IBuffer &inbuf, OBuffer &outbuf, bool finish=false)
 Typed variant of flush().
bool encode (WvBuf &inbuf, WvBuf &outbuf, bool flush=false, bool finish=false)
bool flush (WvBuf &inbuf, WvBuf &outbuf, bool finish=false)
bool finish (OBuffer &outbuf)
 Typed variant of finish().
bool isok () const
 Returns true if the encoder has not encountered an error.
bool isok () const
 Returns true if the encoder has not encountered an error.
bool isfinished () const
 Returns true if the encoder can no longer encode data.
bool isfinished () const
 Returns true if the encoder can no longer encode data.
WvString geterror () const
 Returns an error message if any is available.
WvString geterror () const
 Returns an error message if any is available.
bool reset ()
 Asks an encoder to reset itself to its initial state at creation time, if supported.
bool reset ()
 Asks an encoder to reset itself to its initial state at creation time, if supported.
bool flushstrbuf (WvStringParm instr, WvBuf &outbuf, bool finish=false)
 Flushes data through the encoder from a string to a buffer.
bool flushstrbuf (WvStringParm instr, WvBuf &outbuf, bool finish=false)
 Flushes data through the encoder from a string to a buffer.
bool flushstrstr (WvStringParm instr, WvString &outstr, bool finish=false)
 Flushes data through the encoder from a string to a string.
bool flushstrstr (WvStringParm instr, WvString &outstr, bool finish=false)
 Flushes data through the encoder from a string to a string.
bool encodebufstr (WvBuf &inbuf, WvString &outstr, bool flush=false, bool finish=false)
 Encodes data from a buffer to a string.
bool encodebufstr (WvBuf &inbuf, WvString &outstr, bool flush=false, bool finish=false)
 Encodes data from a buffer to a string.
bool flushbufstr (WvBuf &inbuf, WvString &outstr, bool finish=false)
 Flushes data through the encoder from a buffer to a string.
bool flushbufstr (WvBuf &inbuf, WvString &outstr, bool finish=false)
 Flushes data through the encoder from a buffer to a string.
WvString strflushstr (WvStringParm instr, bool finish=false)
 Flushes data through the encoder from a string to a string.
WvString strflushstr (WvStringParm instr, bool finish=false)
 Flushes data through the encoder from a string to a string.
WvString strflushbuf (WvBuf &inbuf, bool finish=false)
 Flushes data through the encoder from a buffer to a string.
WvString strflushbuf (WvBuf &inbuf, bool finish=false)
 Flushes data through the encoder from a buffer to a string.
bool flushmembuf (const void *inmem, size_t inlen, WvBuf &outbuf, bool finish=false)
 Flushes data through the encoder from memory to a buffer.
bool flushmembuf (const void *inmem, size_t inlen, WvBuf &outbuf, bool finish=false)
 Flushes data through the encoder from memory to a buffer.
bool flushmemmem (const void *inmem, size_t inlen, void *outmem, size_t *outlen, bool finish=false)
 Flushes data through the encoder from memory to memory.
bool flushmemmem (const void *inmem, size_t inlen, void *outmem, size_t *outlen, bool finish=false)
 Flushes data through the encoder from memory to memory.
bool encodebufmem (WvBuf &inbuf, void *outmem, size_t *outlen, bool flush=false, bool finish=false)
 Encodes data from a buffer to memory.
bool encodebufmem (WvBuf &inbuf, void *outmem, size_t *outlen, bool flush=false, bool finish=false)
 Encodes data from a buffer to memory.
bool flushbufmem (WvBuf &inbuf, void *outmem, size_t *outlen, bool finish=false)
 Flushes data through the encoder from a buffer to memory.
bool flushbufmem (WvBuf &inbuf, void *outmem, size_t *outlen, bool finish=false)
 Flushes data through the encoder from a buffer to memory.
bool flushstrmem (WvStringParm instr, void *outmem, size_t *outlen, bool finish=false)
 Flushes data through the encoder from a string to memory.
bool flushstrmem (WvStringParm instr, void *outmem, size_t *outlen, bool finish=false)
 Flushes data through the encoder from a string to memory.
WvString strflushmem (const void *inmem, size_t inlen, bool finish=false)
 Flushes data through the encoder from memory to a string.
WvString strflushmem (const void *inmem, size_t inlen, bool finish=false)
 Flushes data through the encoder from memory to a string.

Protected Member Functions

virtual bool _typedencode (IBuffer &inbuf, OBuffer &outbuf, bool flush)=0
 Typed variant of _encode().
virtual bool _typedfinish (OBuffer &outbuf)
 Typed variant of _finish().
virtual bool _encode (WvBuf &inbuf, WvBuf &outbuf, bool flush)
 Wrapper implementation of _encode().
virtual bool _finish (WvBuf &outbuf)
 Wrapper implementation of _finish().
virtual bool _typedencode (IBuffer &inbuf, OBuffer &outbuf, bool flush)=0
 Typed variant of _encode().
virtual bool _typedfinish (OBuffer &outbuf)
 Typed variant of _finish().
virtual bool _encode (WvBuf &inbuf, WvBuf &outbuf, bool flush)
 Wrapper implementation of _encode().
virtual bool _finish (WvBuf &outbuf)
 Wrapper implementation of _finish().
void setnotok ()
 Sets 'okay' to false explicitly.
void setnotok ()
 Sets 'okay' to false explicitly.
void seterror (WvStringParm message)
 Sets an error condition, then setnotok().
void seterror (WVSTRING_FORMAT_DECL)
 Sets an error condition, then setnotok().
void seterror (WvStringParm message)
 Sets an error condition, then setnotok().
void seterror (WVSTRING_FORMAT_DECL)
 Sets an error condition, then setnotok().
void setfinished ()
 Sets 'finished' to true explicitly.
void setfinished ()
 Sets 'finished' to true explicitly.
virtual bool _isok () const
 Template method implementation of isok().
virtual bool _isok () const
 Template method implementation of isok().
virtual bool _isfinished () const
 Template method implementation of isfinished().
virtual bool _isfinished () const
 Template method implementation of isfinished().
virtual WvString _geterror () const
 Template method implementation of geterror().
virtual WvString _geterror () const
 Template method implementation of geterror().
virtual bool _reset ()
 Template method implementation of reset().
virtual bool _reset ()
 Template method implementation of reset().

Protected Attributes

bool okay
bool finished
WvString errstr

Detailed Description

template<class IT, class S>
class WvTypedEncoder< IT, unsigned char, S >

Partial template specialization for unsigned char output buffer type to avoid compilation errors.

"IType" is the input buffer datatype

Definition at line 130 of file debian/libwvstreams-dev/usr/include/wvstreams/wvtypedencoder.h.

Member Typedef Documentation

◆ IType [1/2]

template<class IT, class S>
typedef IT WvTypedEncoder< IT, unsigned char, S >::IType

◆ OType [1/2]

template<class IT, class S>
typedef unsigned char WvTypedEncoder< IT, unsigned char, S >::OType

◆ IBuffer [1/2]

template<class IT, class S>
typedef WvBufBase<IType> WvTypedEncoder< IT, unsigned char, S >::IBuffer

◆ OBuffer [1/2]

template<class IT, class S>
typedef WvBufBase<OType> WvTypedEncoder< IT, unsigned char, S >::OBuffer

◆ IBufferView [1/2]

template<class IT, class S>
typedef WvBufViewBase<IType> WvTypedEncoder< IT, unsigned char, S >::IBufferView

◆ OBufferView [1/2]

template<class IT, class S>
typedef WvBufViewBase<OType> WvTypedEncoder< IT, unsigned char, S >::OBufferView

◆ IType [2/2]

template<class IT, class S>
typedef IT WvTypedEncoder< IT, unsigned char, S >::IType

Definition at line 133 of file include/wvtypedencoder.h.

◆ OType [2/2]

template<class IT, class S>
typedef unsigned char WvTypedEncoder< IT, unsigned char, S >::OType

Definition at line 134 of file include/wvtypedencoder.h.

◆ IBuffer [2/2]

template<class IT, class S>
typedef WvBufBase<IType> WvTypedEncoder< IT, unsigned char, S >::IBuffer

Definition at line 135 of file include/wvtypedencoder.h.

◆ OBuffer [2/2]

template<class IT, class S>
typedef WvBufBase<OType> WvTypedEncoder< IT, unsigned char, S >::OBuffer

Definition at line 136 of file include/wvtypedencoder.h.

◆ IBufferView [2/2]

template<class IT, class S>
typedef WvBufViewBase<IType> WvTypedEncoder< IT, unsigned char, S >::IBufferView

Definition at line 137 of file include/wvtypedencoder.h.

◆ OBufferView [2/2]

template<class IT, class S>
typedef WvBufViewBase<OType> WvTypedEncoder< IT, unsigned char, S >::OBufferView

Definition at line 138 of file include/wvtypedencoder.h.

Member Function Documentation

◆ encode() [1/4]

template<class IT, class S>
bool WvTypedEncoder< IT, unsigned char, S >::encode ( IBuffer & inbuf,
OBuffer & outbuf,
bool flush = false,
bool finish = false )
inline

Typed variant of encode().

See also
encode(WvBuf&, WvBuf&, bool, bool)

Definition at line 144 of file debian/libwvstreams-dev/usr/include/wvstreams/wvtypedencoder.h.

References finish(), and flush().

◆ flush() [1/4]

template<class IT, class S>
bool WvTypedEncoder< IT, unsigned char, S >::flush ( IBuffer & inbuf,
OBuffer & outbuf,
bool finish = false )
inline

Typed variant of flush().

See also
flush(WvBuf, WvBuf, bool)

Definition at line 155 of file debian/libwvstreams-dev/usr/include/wvstreams/wvtypedencoder.h.

References finish().

Referenced by _encode(), _typedencode(), encode(), and strflushstr().

◆ encode() [2/4]

template<class IT, class S>
bool WvTypedEncoder< IT, unsigned char, S >::encode ( WvBuf & inbuf,
WvBuf & outbuf,
bool flush = false,
bool finish = false )
inline

◆ flush() [2/4]

template<class IT, class S>
bool WvTypedEncoder< IT, unsigned char, S >::flush ( WvBuf & inbuf,
WvBuf & outbuf,
bool finish = false )
inline

◆ _typedencode() [1/2]

template<class IT, class S>
virtual bool WvTypedEncoder< IT, unsigned char, S >::_typedencode ( IBuffer & inbuf,
OBuffer & outbuf,
bool flush )
protectedpure virtual

Typed variant of _encode().

See also
_encode(WvBuf&, WvBuf&, bool)

References flush().

◆ _typedfinish() [1/2]

template<class IT, class S>
virtual bool WvTypedEncoder< IT, unsigned char, S >::_typedfinish ( OBuffer & outbuf)
inlineprotectedvirtual

◆ _encode() [1/2]

template<class IT, class S>
virtual bool WvTypedEncoder< IT, unsigned char, S >::_encode ( WvBuf & inbuf,
WvBuf & outbuf,
bool flush )
inlineprotectedvirtual

◆ _finish() [1/2]

template<class IT, class S>
virtual bool WvTypedEncoder< IT, unsigned char, S >::_finish ( WvBuf & outbuf)
inlineprotectedvirtual

◆ encode() [3/4]

template<class IT, class S>
bool WvTypedEncoder< IT, unsigned char, S >::encode ( IBuffer & inbuf,
OBuffer & outbuf,
bool flush = false,
bool finish = false )
inline

Typed variant of encode().

See also
encode(WvBuf&, WvBuf&, bool, bool)

Definition at line 144 of file include/wvtypedencoder.h.

References finish(), and flush().

◆ flush() [3/4]

template<class IT, class S>
bool WvTypedEncoder< IT, unsigned char, S >::flush ( IBuffer & inbuf,
OBuffer & outbuf,
bool finish = false )
inline

Typed variant of flush().

See also
flush(WvBuf, WvBuf, bool)

Definition at line 155 of file include/wvtypedencoder.h.

References finish().

◆ encode() [4/4]

template<class IT, class S>
bool WvTypedEncoder< IT, unsigned char, S >::encode ( WvBuf & inbuf,
WvBuf & outbuf,
bool flush = false,
bool finish = false )
inline

Definition at line 161 of file include/wvtypedencoder.h.

◆ flush() [4/4]

template<class IT, class S>
bool WvTypedEncoder< IT, unsigned char, S >::flush ( WvBuf & inbuf,
WvBuf & outbuf,
bool finish = false )
inline

Definition at line 166 of file include/wvtypedencoder.h.

◆ _typedencode() [2/2]

template<class IT, class S>
virtual bool WvTypedEncoder< IT, unsigned char, S >::_typedencode ( IBuffer & inbuf,
OBuffer & outbuf,
bool flush )
protectedpure virtual

Typed variant of _encode().

See also
_encode(WvBuf&, WvBuf&, bool)

References flush().

◆ _typedfinish() [2/2]

template<class IT, class S>
virtual bool WvTypedEncoder< IT, unsigned char, S >::_typedfinish ( OBuffer & outbuf)
inlineprotectedvirtual

Typed variant of _finish().

See also
_finish(WvBuf&)

Definition at line 184 of file include/wvtypedencoder.h.

◆ _encode() [2/2]

template<class IT, class S>
virtual bool WvTypedEncoder< IT, unsigned char, S >::_encode ( WvBuf & inbuf,
WvBuf & outbuf,
bool flush )
inlineprotectedvirtual

Wrapper implementation of _encode().

Definition at line 188 of file include/wvtypedencoder.h.

References WvTypedEncoder< IT, OT, S >::_typedencode(), and flush().

◆ _finish() [2/2]

template<class IT, class S>
virtual bool WvTypedEncoder< IT, unsigned char, S >::_finish ( WvBuf & outbuf)
inlineprotectedvirtual

Wrapper implementation of _finish().

Definition at line 196 of file include/wvtypedencoder.h.

References WvTypedEncoder< IT, OT, S >::_typedfinish().

◆ finish()

bool WvTypedEncoder< IT, unsigned char, S >::finish ( OBuffer & outbuf)
inline

Typed variant of finish().

See also
finish(WvBuf)

Definition at line 70 of file debian/libwvstreams-dev/usr/include/wvstreams/wvtypedencoder.h.

Referenced by encode(), flush(), geterror(), and strflushstr().

◆ isok() [1/2]

bool WvEncoder::isok ( ) const
inline

Returns true if the encoder has not encountered an error.

This should only be used to record permanent failures. Transient errors (eg. bad block, but recoverable) should be detected in a different fashion.

Returns: true if the encoder is ok

Definition at line 90 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ isok() [2/2]

bool WvEncoder::isok ( ) const
inline

Returns true if the encoder has not encountered an error.

This should only be used to record permanent failures. Transient errors (eg. bad block, but recoverable) should be detected in a different fashion.

Returns: true if the encoder is ok

Definition at line 90 of file include/wvencoder.h.

◆ isfinished() [1/2]

bool WvEncoder::isfinished ( ) const
inline

Returns true if the encoder can no longer encode data.

This will be set when the encoder detects and end-of-data mark in its input, or when finish() is called.

Returns: true if the encoder is finished

Definition at line 101 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ isfinished() [2/2]

bool WvEncoder::isfinished ( ) const
inline

Returns true if the encoder can no longer encode data.

This will be set when the encoder detects and end-of-data mark in its input, or when finish() is called.

Returns: true if the encoder is finished

Definition at line 101 of file include/wvencoder.h.

◆ geterror() [1/2]

Returns an error message if any is available.

Returns: the error message, or the null string is isok() == true

Definition at line 109 of file wvencoder.cc.

References finish().

◆ geterror() [2/2]

Returns an error message if any is available.

Returns: the error message, or the null string is isok() == true

◆ reset() [1/2]

bool WvEncoder::reset ( )

Asks an encoder to reset itself to its initial state at creation time, if supported.

This function may be called at any time, even if isok() == false, or isfinished() == true.

If the behaviour is not supported or an error occurs, then false is returned and afterwards isok() == false.

Returns: true on success

See also
_reset for the actual implementation

Definition at line 199 of file wvencoder.cc.

◆ reset() [2/2]

bool WvEncoder::reset ( )

Asks an encoder to reset itself to its initial state at creation time, if supported.

This function may be called at any time, even if isok() == false, or isfinished() == true.

If the behaviour is not supported or an error occurs, then false is returned and afterwards isok() == false.

Returns: true on success

See also
_reset for the actual implementation

◆ flushstrbuf() [1/2]

bool WvEncoder::flushstrbuf ( WvStringParm instr,
WvBuf & outbuf,
bool finish = false )

Flushes data through the encoder from a string to a buffer.

"instr" is the input string "outbuf" is the output buffer "finish" is if true, calls finish() on success Returns: true on success

Definition at line 209 of file wvencoder.cc.

◆ flushstrbuf() [2/2]

bool WvEncoder::flushstrbuf ( WvStringParm instr,
WvBuf & outbuf,
bool finish = false )

Flushes data through the encoder from a string to a buffer.

"instr" is the input string "outbuf" is the output buffer "finish" is if true, calls finish() on success Returns: true on success

◆ flushstrstr() [1/2]

bool WvEncoder::flushstrstr ( WvStringParm instr,
WvString & outstr,
bool finish = false )

Flushes data through the encoder from a string to a string.

The output data is appended to the target string.

"instr" is the input string "outstr" is the output string "finish" is if true, calls finish() on success Returns: true on success

Definition at line 222 of file wvencoder.cc.

◆ flushstrstr() [2/2]

bool WvEncoder::flushstrstr ( WvStringParm instr,
WvString & outstr,
bool finish = false )

Flushes data through the encoder from a string to a string.

The output data is appended to the target string.

"instr" is the input string "outstr" is the output string "finish" is if true, calls finish() on success Returns: true on success

◆ encodebufstr() [1/2]

bool WvEncoder::encodebufstr ( WvBuf & inbuf,
WvString & outstr,
bool flush = false,
bool finish = false )

Encodes data from a buffer to a string.

The output data is appended to the target string.

"inbuf" is the input buffer "outstr" is the output string "flush" is if true, flushes the encoder "finish" is if true, calls finish() on success Returns: true on success

Definition at line 236 of file wvencoder.cc.

◆ encodebufstr() [2/2]

bool WvEncoder::encodebufstr ( WvBuf & inbuf,
WvString & outstr,
bool flush = false,
bool finish = false )

Encodes data from a buffer to a string.

The output data is appended to the target string.

"inbuf" is the input buffer "outstr" is the output string "flush" is if true, flushes the encoder "finish" is if true, calls finish() on success Returns: true on success

◆ flushbufstr() [1/2]

bool WvEncoder::flushbufstr ( WvBuf & inbuf,
WvString & outstr,
bool finish = false )
inline

Flushes data through the encoder from a buffer to a string.

The output data is appended to the target string.

"inbuf" is the input buffer "outstr" is the output string "finish" is if true, calls finish() on success Returns: true on success

Definition at line 249 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ flushbufstr() [2/2]

bool WvEncoder::flushbufstr ( WvBuf & inbuf,
WvString & outstr,
bool finish = false )
inline

Flushes data through the encoder from a buffer to a string.

The output data is appended to the target string.

"inbuf" is the input buffer "outstr" is the output string "finish" is if true, calls finish() on success Returns: true on success

Definition at line 249 of file include/wvencoder.h.

◆ strflushstr() [1/2]

WvString WvEncoder::strflushstr ( WvStringParm instr,
bool finish = false )

Flushes data through the encoder from a string to a string.

"inbuf" is the input buffer "finish" is if true, calls finish() on success Returns: the resulting encoded string, does not signal errors

Definition at line 260 of file wvencoder.cc.

References finish(), and flush().

◆ strflushstr() [2/2]

WvString WvEncoder::strflushstr ( WvStringParm instr,
bool finish = false )

Flushes data through the encoder from a string to a string.

"inbuf" is the input buffer "finish" is if true, calls finish() on success Returns: the resulting encoded string, does not signal errors

◆ strflushbuf() [1/2]

WvString WvEncoder::strflushbuf ( WvBuf & inbuf,
bool finish = false )

Flushes data through the encoder from a buffer to a string.

"inbuf" is the input buffer "finish" is if true, calls finish() on success Returns: the resulting encoded string, does not signal errors

Definition at line 269 of file wvencoder.cc.

◆ strflushbuf() [2/2]

WvString WvEncoder::strflushbuf ( WvBuf & inbuf,
bool finish = false )

Flushes data through the encoder from a buffer to a string.

"inbuf" is the input buffer "finish" is if true, calls finish() on success Returns: the resulting encoded string, does not signal errors

◆ flushmembuf() [1/2]

bool WvEncoder::flushmembuf ( const void * inmem,
size_t inlen,
WvBuf & outbuf,
bool finish = false )

Flushes data through the encoder from memory to a buffer.

"inmem" is the input data pointer "inlen" is the input data length "outbuf" is the output buffer "finish" is if true, calls finish() on success Returns: true on success

Definition at line 280 of file wvencoder.cc.

◆ flushmembuf() [2/2]

bool WvEncoder::flushmembuf ( const void * inmem,
size_t inlen,
WvBuf & outbuf,
bool finish = false )

Flushes data through the encoder from memory to a buffer.

"inmem" is the input data pointer "inlen" is the input data length "outbuf" is the output buffer "finish" is if true, calls finish() on success Returns: true on success

◆ flushmemmem() [1/2]

bool WvEncoder::flushmemmem ( const void * inmem,
size_t inlen,
void * outmem,
size_t * outlen,
bool finish = false )

Flushes data through the encoder from memory to memory.

The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.

"inmem" is the input data pointer "inlen" is the input data length "outmem" is the output data pointer "outlen" is the output data length, by reference "finish" is if true, calls finish() on success Returns: true on success

Definition at line 299 of file wvencoder.cc.

◆ flushmemmem() [2/2]

bool WvEncoder::flushmemmem ( const void * inmem,
size_t inlen,
void * outmem,
size_t * outlen,
bool finish = false )

Flushes data through the encoder from memory to memory.

The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.

"inmem" is the input data pointer "inlen" is the input data length "outmem" is the output data pointer "outlen" is the output data length, by reference "finish" is if true, calls finish() on success Returns: true on success

◆ encodebufmem() [1/2]

bool WvEncoder::encodebufmem ( WvBuf & inbuf,
void * outmem,
size_t * outlen,
bool flush = false,
bool finish = false )

Encodes data from a buffer to memory.

The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.

"inmem" is the input data pointer "inlen" is the input data length "outmem" is the output data pointer "outlen" is the output data length, by reference "flush" is if true, flushes the encoder "finish" is if true, calls finish() on success Returns: true on success

Definition at line 319 of file wvencoder.cc.

◆ encodebufmem() [2/2]

bool WvEncoder::encodebufmem ( WvBuf & inbuf,
void * outmem,
size_t * outlen,
bool flush = false,
bool finish = false )

Encodes data from a buffer to memory.

The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.

"inmem" is the input data pointer "inlen" is the input data length "outmem" is the output data pointer "outlen" is the output data length, by reference "flush" is if true, flushes the encoder "finish" is if true, calls finish() on success Returns: true on success

◆ flushbufmem() [1/2]

bool WvEncoder::flushbufmem ( WvBuf & inbuf,
void * outmem,
size_t * outlen,
bool finish = false )
inline

Flushes data through the encoder from a buffer to memory.

The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.

"inbuf" is the input buffer "outmem" is the output data pointer "outlen" is the output data length, by reference "finish" is if true, calls finish() on success Returns: true on success

Definition at line 337 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ flushbufmem() [2/2]

bool WvEncoder::flushbufmem ( WvBuf & inbuf,
void * outmem,
size_t * outlen,
bool finish = false )
inline

Flushes data through the encoder from a buffer to memory.

The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.

"inbuf" is the input buffer "outmem" is the output data pointer "outlen" is the output data length, by reference "finish" is if true, calls finish() on success Returns: true on success

Definition at line 337 of file include/wvencoder.h.

◆ flushstrmem() [1/2]

bool WvEncoder::flushstrmem ( WvStringParm instr,
void * outmem,
size_t * outlen,
bool finish = false )

Flushes data through the encoder from a string to memory.

The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.

"instr" is the input string "outmem" is the output data pointer "outlen" is the output data length, by reference "finish" is if true, calls finish() on success Returns: true on success

Definition at line 356 of file wvencoder.cc.

◆ flushstrmem() [2/2]

bool WvEncoder::flushstrmem ( WvStringParm instr,
void * outmem,
size_t * outlen,
bool finish = false )

Flushes data through the encoder from a string to memory.

The outlen parameter specifies by reference the length of the output buffer. It is updated in place to reflect the number of bytes copied to the output buffer. If the buffer was too small to hold the data, the overflow bytes will be discarded and false will be returned.

"instr" is the input string "outmem" is the output data pointer "outlen" is the output data length, by reference "finish" is if true, calls finish() on success Returns: true on success

◆ strflushmem() [1/2]

WvString WvEncoder::strflushmem ( const void * inmem,
size_t inlen,
bool finish = false )

Flushes data through the encoder from memory to a string.

"inmem" is the input data pointer "inlen" is the input data length "finish" is if true, calls finish() on success Returns: the resulting encoded string, does not signal errors

Definition at line 367 of file wvencoder.cc.

◆ strflushmem() [2/2]

WvString WvEncoder::strflushmem ( const void * inmem,
size_t inlen,
bool finish = false )

Flushes data through the encoder from memory to a string.

"inmem" is the input data pointer "inlen" is the input data length "finish" is if true, calls finish() on success Returns: the resulting encoded string, does not signal errors

◆ setnotok() [1/2]

void WvEncoder::setnotok ( )
inlineprotected

Sets 'okay' to false explicitly.

Definition at line 371 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ setnotok() [2/2]

void WvEncoder::setnotok ( )
inlineprotected

Sets 'okay' to false explicitly.

Definition at line 371 of file include/wvencoder.h.

◆ seterror() [1/4]

void WvEncoder::seterror ( WvStringParm message)
inlineprotected

Sets an error condition, then setnotok().

Definition at line 375 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ seterror() [2/4]

void WvEncoder::seterror ( WVSTRING_FORMAT_DECL )
inlineprotected

Sets an error condition, then setnotok().

Definition at line 379 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ seterror() [3/4]

void WvEncoder::seterror ( WvStringParm message)
inlineprotected

Sets an error condition, then setnotok().

Definition at line 375 of file include/wvencoder.h.

◆ seterror() [4/4]

void WvEncoder::seterror ( WVSTRING_FORMAT_DECL )
inlineprotected

Sets an error condition, then setnotok().

Definition at line 379 of file include/wvencoder.h.

◆ setfinished() [1/2]

void WvEncoder::setfinished ( )
inlineprotected

Sets 'finished' to true explicitly.

Definition at line 383 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ setfinished() [2/2]

void WvEncoder::setfinished ( )
inlineprotected

Sets 'finished' to true explicitly.

Definition at line 383 of file include/wvencoder.h.

◆ _isok() [1/2]

virtual bool WvEncoder::_isok ( ) const
inlineprotectedvirtual

Template method implementation of isok().

Not called if any of the following cases are true:

  • okay == false

Most implementations do not need to override this.

Returns: true if the encoder is ok

See also
setnotok

Definition at line 400 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ _isok() [2/2]

virtual bool WvEncoder::_isok ( ) const
inlineprotectedvirtual

Template method implementation of isok().

Not called if any of the following cases are true:

  • okay == false

Most implementations do not need to override this.

Returns: true if the encoder is ok

See also
setnotok

Definition at line 400 of file include/wvencoder.h.

◆ _isfinished() [1/2]

virtual bool WvEncoder::_isfinished ( ) const
inlineprotectedvirtual

Template method implementation of isfinished().

Not called if any of the following cases are true:

  • finished == true

Most implementations do not need to override this.

Returns: true if the encoder is finished

See also
setfinished

Definition at line 416 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ _isfinished() [2/2]

virtual bool WvEncoder::_isfinished ( ) const
inlineprotectedvirtual

Template method implementation of isfinished().

Not called if any of the following cases are true:

  • finished == true

Most implementations do not need to override this.

Returns: true if the encoder is finished

See also
setfinished

Definition at line 416 of file include/wvencoder.h.

◆ _geterror() [1/2]

virtual WvString WvEncoder::_geterror ( ) const
inlineprotectedvirtual

Template method implementation of geterror().

Not called if any of the following cases are true:

  • isok() == true
  • errstr is not null

Most implementations do not need to override this.

Returns: the error message, or the null string if _isok() == true

See also
seterror

Definition at line 433 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ _geterror() [2/2]

virtual WvString WvEncoder::_geterror ( ) const
inlineprotectedvirtual

Template method implementation of geterror().

Not called if any of the following cases are true:

  • isok() == true
  • errstr is not null

Most implementations do not need to override this.

Returns: the error message, or the null string if _isok() == true

See also
seterror

Definition at line 433 of file include/wvencoder.h.

◆ _reset() [1/2]

virtual bool WvEncoder::_reset ( )
inlineprotectedvirtual

Template method implementation of reset().

When this method is invoked, the current local state will be okay == true and finished == false. If false is returned, then okay will be set to false.

May set a detailed error message if an error occurs.

Returns: true on success, false on error or if not supported

See also
reset

Definition at line 498 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ _reset() [2/2]

virtual bool WvEncoder::_reset ( )
inlineprotectedvirtual

Template method implementation of reset().

When this method is invoked, the current local state will be okay == true and finished == false. If false is returned, then okay will be set to false.

May set a detailed error message if an error occurs.

Returns: true on success, false on error or if not supported

See also
reset

Definition at line 498 of file include/wvencoder.h.

Member Data Documentation

◆ okay

bool WvEncoder::okay
protected

false iff setnotok() was called

Definition at line 70 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ finished

bool WvEncoder::finished
protected

true iff setfinished()/finish() was called

Definition at line 71 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.

◆ errstr

the error message

Definition at line 72 of file debian/libwvstreams-dev/usr/include/wvstreams/wvencoder.h.


The documentation for this class was generated from the following files: