Into

Modules

Documentation

classPiiStreamFilter

#include <PiiStreamFilter.h>

An interface for stream filters.

Inherited by PiiDefaultStreamFilter, PiiHttpDevice

Description

A stream filter is a class that converts data written to it and writes it either to another filter or somewhere else. Input data to the filter is sent with the #writeToStream() function. Filter chains can be though of as linked lists. The last filter on the list has no output filter.

Constructors and destructor

virtual

Public member functions

virtual qint64

Returns the number of bytes buffered into the filter and pending output.

qint64
( )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Writes data to the filter and returns the number of bytes written.

virtual qint64
(
  • const char * data
  • qint64 maxSize
)  = 0

Writes at most maxSize bytes of data to this output filter.

virtual qint64

Flushes all buffered data to the output filter.

virtual PiiStreamFilter *

Returns the next output filter in the filter chain.

virtual void

Sets the next output filter in the filter chain.

Protected member functions

Function details

  • PiiStreamFilter

    ()
    [protected]
  • virtual ~PiiStreamFilter

    ()
    [virtual]
  • virtual qint64 bufferedSize

    ()
    [virtual]

    Returns the number of bytes buffered into the filter and pending output.

    If the filter does not buffer data or does not know how much data is yet to come, it must return -1. The default implementation returns -1.

  • qint64 filterData

    ( )

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Writes data to the filter and returns the number of bytes written.

  • virtual qint64 filterData

    (
    • const char * data
    • qint64 maxSize
    )
    [pure virtual]

    Writes at most maxSize bytes of data to this output filter.

    Returns the number of bytes actually written.

  • virtual qint64 flushFilter

    ()
    [virtual]

    Flushes all buffered data to the output filter.

    Returns the number of bytes written. The default implementation returns 0.

  • virtual PiiStreamFilter * outputFilter

    ()
    [virtual]

    Returns the next output filter in the filter chain.

    The default implementation returns 0.

  • virtual void setOutputFilter

    ( )
    [virtual]

    Sets the next output filter in the filter chain.

    If the output filter is non-null, this filter writes its data to it after conversion. The default implementation does nothing.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.