WvStreams
WvTypedEncoder< IT, OT, S > Class Template Referenceabstract

This template facilitates the creation and use of encoders that manipulate typed buffers. More...

#include <wvtypedencoder.h>

Inheritance diagram for WvTypedEncoder< IT, OT, S >:

Public Types

typedef IT IType
typedef OT OType
typedef WvBufBase< IType > IBuffer
typedef WvBufBase< OType > OBuffer
typedef WvBufViewBase< IType > IBufferView
typedef WvBufViewBase< OType > OBufferView
typedef IT IType
typedef OT 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 finish (OBuffer &outbuf)
 Typed variant of finish().
bool encode (WvBuf &inbuf, WvBuf &outbuf, bool flush=false, bool finish=false)
bool flush (WvBuf &inbuf, WvBuf &outbuf, bool finish=false)
bool finish (WvBuf &outbuf)
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 finish (OBuffer &outbuf)
 Typed variant of finish().
bool encode (WvBuf &inbuf, WvBuf &outbuf, bool flush=false, bool finish=false)
bool flush (WvBuf &inbuf, WvBuf &outbuf, bool finish=false)
bool finish (WvBuf &outbuf)
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 OT, class S = WvEncoder>
class WvTypedEncoder< IT, OT, S >

This template facilitates the creation and use of encoders that manipulate typed buffers.

A typed encoder accepts both typed and untyped buffers, but is implementated in terms of typed buffers. Untyped buffers are automatically wrapped into the required form before being passed on to the implementation.

This type is designed to function as a statically bound mixin to make it easier to incorporate typed encoders into untyped encoder hierarchies. This is somewhat ugly, but necessary.

"IT" is the input buffer datatype "OT" is the output buffer datatype "S" is the WvEncoder supertype

See also
WvEncoder

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

Member Typedef Documentation

◆ IType [1/2]

template<class IT, class OT, class S = WvEncoder>
typedef IT WvTypedEncoder< IT, OT, S >::IType

◆ OType [1/2]

template<class IT, class OT, class S = WvEncoder>
typedef OT WvTypedEncoder< IT, OT, S >::OType

◆ IBuffer [1/2]

template<class IT, class OT, class S = WvEncoder>
typedef WvBufBase<IType> WvTypedEncoder< IT, OT, S >::IBuffer

◆ OBuffer [1/2]

template<class IT, class OT, class S = WvEncoder>
typedef WvBufBase<OType> WvTypedEncoder< IT, OT, S >::OBuffer

◆ IBufferView [1/2]

template<class IT, class OT, class S = WvEncoder>
typedef WvBufViewBase<IType> WvTypedEncoder< IT, OT, S >::IBufferView

◆ OBufferView [1/2]

template<class IT, class OT, class S = WvEncoder>
typedef WvBufViewBase<OType> WvTypedEncoder< IT, OT, S >::OBufferView

◆ IType [2/2]

template<class IT, class OT, class S = WvEncoder>
typedef IT WvTypedEncoder< IT, OT, S >::IType

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

◆ OType [2/2]

template<class IT, class OT, class S = WvEncoder>
typedef OT WvTypedEncoder< IT, OT, S >::OType

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

◆ IBuffer [2/2]

template<class IT, class OT, class S = WvEncoder>
typedef WvBufBase<IType> WvTypedEncoder< IT, OT, S >::IBuffer

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

◆ OBuffer [2/2]

template<class IT, class OT, class S = WvEncoder>
typedef WvBufBase<OType> WvTypedEncoder< IT, OT, S >::OBuffer

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

◆ IBufferView [2/2]

template<class IT, class OT, class S = WvEncoder>
typedef WvBufViewBase<IType> WvTypedEncoder< IT, OT, S >::IBufferView

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

◆ OBufferView [2/2]

template<class IT, class OT, class S = WvEncoder>
typedef WvBufViewBase<OType> WvTypedEncoder< IT, OT, S >::OBufferView

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

Member Function Documentation

◆ encode() [1/4]

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

◆ flush() [1/4]

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

Typed variant of flush().

See also
flush(WvBuf, WvBuf, bool)

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

References finish().

Referenced by _encode(), WvFunctorEncoder< IT, OT, FT >::_typedencode(), _typedencode(), and encode().

◆ finish() [1/4]

template<class IT, class OT, class S = WvEncoder>
bool WvTypedEncoder< IT, OT, 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(), and flush().

◆ encode() [2/4]

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

◆ flush() [2/4]

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

◆ finish() [2/4]

template<class IT, class OT, class S = WvEncoder>
bool WvTypedEncoder< IT, OT, S >::finish ( WvBuf & outbuf)
inline

◆ _typedencode() [1/2]

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

◆ _typedfinish() [1/2]

template<class IT, class OT, class S = WvEncoder>
virtual bool WvTypedEncoder< IT, OT, S >::_typedfinish ( OBuffer & outbuf)
inlineprotectedvirtual

◆ _encode() [1/2]

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

Wrapper implementation of _encode().

Implements WvEncoder.

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

References _typedencode(), and flush().

◆ _finish() [1/2]

template<class IT, class OT, class S = WvEncoder>
virtual bool WvTypedEncoder< IT, OT, S >::_finish ( WvBuf & outbuf)
inlineprotectedvirtual

Wrapper implementation of _finish().

Reimplemented from WvEncoder.

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

References _typedfinish().

◆ encode() [3/4]

template<class IT, class OT, class S = WvEncoder>
bool WvTypedEncoder< IT, OT, 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 47 of file include/wvtypedencoder.h.

References finish(), and flush().

◆ flush() [3/4]

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

Typed variant of flush().

See also
flush(WvBuf, WvBuf, bool)

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

References finish().

◆ finish() [3/4]

template<class IT, class OT, class S = WvEncoder>
bool WvTypedEncoder< IT, OT, S >::finish ( OBuffer & outbuf)
inline

Typed variant of finish().

See also
finish(WvBuf)

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

◆ encode() [4/4]

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

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

◆ flush() [4/4]

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

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

◆ finish() [4/4]

template<class IT, class OT, class S = WvEncoder>
bool WvTypedEncoder< IT, OT, S >::finish ( WvBuf & outbuf)
inline

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

◆ _typedencode() [2/2]

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

◆ _typedfinish() [2/2]

template<class IT, class OT, class S = WvEncoder>
virtual bool WvTypedEncoder< IT, OT, S >::_typedfinish ( OBuffer & outbuf)
inlineprotectedvirtual

Typed variant of _finish().

See also
_finish(WvBuf&)

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

◆ _encode() [2/2]

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

Wrapper implementation of _encode().

Implements WvEncoder.

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

References _typedencode(), and flush().

◆ _finish() [2/2]

template<class IT, class OT, class S = WvEncoder>
virtual bool WvTypedEncoder< IT, OT, S >::_finish ( WvBuf & outbuf)
inlineprotectedvirtual

Wrapper implementation of _finish().

Reimplemented from WvEncoder.

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

References _typedfinish().

◆ isok() [1/2]

bool WvEncoder::isok ( ) const
inlineinherited

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.

References _isok(), and okay.

Referenced by geterror().

◆ isok() [2/2]

bool WvEncoder::isok ( ) const
inlineinherited

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.

References _isok(), and okay.

◆ isfinished() [1/2]

bool WvEncoder::isfinished ( ) const
inlineinherited

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.

References _isfinished(), and finished.

◆ isfinished() [2/2]

bool WvEncoder::isfinished ( ) const
inlineinherited

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.

References _isfinished(), and finished.

◆ geterror() [1/2]

WvString WvEncoder::geterror ( ) const
inherited

Returns an error message if any is available.

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

Definition at line 23 of file wvencoder.cc.

References _geterror(), errstr, and isok().

◆ geterror() [2/2]

WvString WvEncoder::geterror ( ) const
inherited

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 ( )
inherited

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 60 of file wvencoder.cc.

References _reset(), errstr, finished, okay, and seterror().

◆ reset() [2/2]

bool WvEncoder::reset ( )
inherited

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 )
inherited

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 77 of file wvencoder.cc.

References encode(), and finish().

◆ flushstrbuf() [2/2]

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

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

References finish().

◆ flushstrstr() [1/2]

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

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 86 of file wvencoder.cc.

References encode(), finish(), and WvBufBase< unsigned char >::getstr().

◆ flushstrstr() [2/2]

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

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

References finish().

◆ encodebufstr() [1/2]

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

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 97 of file wvencoder.cc.

References encode(), finish(), flush(), and WvBufBase< unsigned char >::getstr().

Referenced by flushbufstr().

◆ encodebufstr() [2/2]

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

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

References finish(), and flush().

◆ flushbufstr() [1/2]

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

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.

References encodebufstr(), and finish().

Referenced by strflushbuf().

◆ flushbufstr() [2/2]

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

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.

References encodebufstr(), and finish().

◆ strflushstr() [1/2]

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

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 107 of file wvencoder.cc.

References finish().

Referenced by WvDBusServerAuth::authorize().

◆ strflushstr() [2/2]

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

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

References finish().

◆ strflushbuf() [1/2]

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

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 115 of file wvencoder.cc.

References finish(), and flushbufstr().

Referenced by WvX509Mgr::sign(), and strflushmem().

◆ strflushbuf() [2/2]

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

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

References finish().

◆ flushmembuf() [1/2]

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

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 123 of file wvencoder.cc.

References encode(), and finish().

◆ flushmembuf() [2/2]

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

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

References finish().

◆ flushmemmem() [1/2]

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

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 132 of file wvencoder.cc.

References encodebufmem(), and finish().

Referenced by unhexify().

◆ flushmemmem() [2/2]

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

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

References finish().

◆ encodebufmem() [1/2]

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

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 140 of file wvencoder.cc.

References encode(), finish(), flush(), and WvBufBaseCommonImpl< T >::used().

Referenced by flushbufmem(), and flushmemmem().

◆ encodebufmem() [2/2]

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

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

References finish(), and flush().

◆ flushbufmem() [1/2]

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

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.

References encodebufmem(), and finish().

Referenced by flushstrmem().

◆ flushbufmem() [2/2]

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

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.

References encodebufmem(), and finish().

◆ flushstrmem() [1/2]

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

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 150 of file wvencoder.cc.

References finish(), and flushbufmem().

Referenced by WvX509::verify().

◆ flushstrmem() [2/2]

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

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

References finish().

◆ strflushmem() [1/2]

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

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 158 of file wvencoder.cc.

References finish(), and strflushbuf().

◆ strflushmem() [2/2]

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

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

References finish().

◆ setnotok() [1/2]

void WvEncoder::setnotok ( )
inlineprotectedinherited

Sets 'okay' to false explicitly.

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

References okay.

Referenced by seterror().

◆ setnotok() [2/2]

void WvEncoder::setnotok ( )
inlineprotectedinherited

Sets 'okay' to false explicitly.

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

References okay.

◆ seterror() [1/4]

void WvEncoder::seterror ( WvStringParm message)
inlineprotectedinherited

Sets an error condition, then setnotok().

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

References errstr, and setnotok().

Referenced by WvBase64Decoder::_encode(), WvHexDecoder::_encode(), reset(), and seterror().

◆ seterror() [2/4]

void WvEncoder::seterror ( WVSTRING_FORMAT_DECL )
inlineprotectedinherited

Sets an error condition, then setnotok().

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

References seterror().

◆ seterror() [3/4]

void WvEncoder::seterror ( WvStringParm message)
inlineprotectedinherited

Sets an error condition, then setnotok().

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

References errstr, and setnotok().

◆ seterror() [4/4]

void WvEncoder::seterror ( WVSTRING_FORMAT_DECL )
inlineprotectedinherited

Sets an error condition, then setnotok().

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

References seterror().

◆ setfinished() [1/2]

void WvEncoder::setfinished ( )
inlineprotectedinherited

Sets 'finished' to true explicitly.

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

References finished.

Referenced by WvBase64Decoder::_encode(), and finish().

◆ setfinished() [2/2]

void WvEncoder::setfinished ( )
inlineprotectedinherited

Sets 'finished' to true explicitly.

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

References finished.

◆ _isok() [1/2]

virtual bool WvEncoder::_isok ( ) const
inlineprotectedvirtualinherited

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

Reimplemented in WvEncoderChain, and WvEncoderChain.

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

Referenced by isok().

◆ _isok() [2/2]

virtual bool WvEncoder::_isok ( ) const
inlineprotectedvirtualinherited

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

Reimplemented in WvEncoderChain, and WvEncoderChain.

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

◆ _isfinished() [1/2]

virtual bool WvEncoder::_isfinished ( ) const
inlineprotectedvirtualinherited

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

Reimplemented in WvEncoderChain, and WvEncoderChain.

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

Referenced by isfinished().

◆ _isfinished() [2/2]

virtual bool WvEncoder::_isfinished ( ) const
inlineprotectedvirtualinherited

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

Reimplemented in WvEncoderChain, and WvEncoderChain.

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

◆ _geterror() [1/2]

virtual WvString WvEncoder::_geterror ( ) const
inlineprotectedvirtualinherited

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

Reimplemented in WvEncoderChain, and WvEncoderChain.

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

Referenced by geterror().

◆ _geterror() [2/2]

virtual WvString WvEncoder::_geterror ( ) const
inlineprotectedvirtualinherited

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

Reimplemented in WvEncoderChain, and WvEncoderChain.

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

◆ _reset() [1/2]

virtual bool WvEncoder::_reset ( )
inlineprotectedvirtualinherited

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

Reimplemented in WvAdler32Digest, WvAdler32Digest, WvBackslashDecoder, WvBackslashDecoder, WvBackslashEncoder, WvBackslashEncoder, WvBase64Decoder, WvBase64Decoder, WvBase64Encoder, WvBase64Encoder, WvBlowfishEncoder, WvBlowfishEncoder, WvCrc32Digest, WvCrc32Digest, WvEncoderChain, WvEncoderChain, WvEVPMDDigest, WvEVPMDDigest, WvFunctorEncoder< IT, OT, FT >, WvFunctorEncoder< IT, OT, FT >, WvGzipEncoder, WvGzipEncoder, WvHexDecoder, WvHexDecoder, WvHexEncoder, WvHexEncoder, WvHMACDigest, WvHMACDigest, WvNullEncoder, WvNullEncoder, WvPassthroughEncoder, WvPassthroughEncoder, WvRSAEncoder, WvRSAEncoder, WvTripleDESEncoder, WvTripleDESEncoder, WvWordWrapEncoder, and WvWordWrapEncoder.

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

Referenced by reset().

◆ _reset() [2/2]

virtual bool WvEncoder::_reset ( )
inlineprotectedvirtualinherited

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

Reimplemented in WvAdler32Digest, WvAdler32Digest, WvBackslashDecoder, WvBackslashDecoder, WvBackslashEncoder, WvBackslashEncoder, WvBase64Decoder, WvBase64Decoder, WvBase64Encoder, WvBase64Encoder, WvBlowfishEncoder, WvBlowfishEncoder, WvCrc32Digest, WvCrc32Digest, WvEncoderChain, WvEncoderChain, WvEVPMDDigest, WvEVPMDDigest, WvFunctorEncoder< IT, OT, FT >, WvFunctorEncoder< IT, OT, FT >, WvGzipEncoder, WvGzipEncoder, WvHexDecoder, WvHexDecoder, WvHexEncoder, WvHexEncoder, WvHMACDigest, WvHMACDigest, WvNullEncoder, WvNullEncoder, WvPassthroughEncoder, WvPassthroughEncoder, WvRSAEncoder, WvRSAEncoder, WvTripleDESEncoder, WvTripleDESEncoder, WvWordWrapEncoder, and WvWordWrapEncoder.

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

Member Data Documentation

◆ okay

bool WvEncoder::okay
protectedinherited

false iff setnotok() was called

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

Referenced by encode(), finish(), isok(), reset(), setnotok(), and WvEncoder().

◆ finished

bool WvEncoder::finished
protectedinherited

true iff setfinished()/finish() was called

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

Referenced by encode(), finish(), isfinished(), reset(), setfinished(), and WvEncoder().

◆ errstr

WvString WvEncoder::errstr
protectedinherited

the error message

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

Referenced by geterror(), reset(), and seterror().


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