Class TFilterBlobStream (unit Fltcback)

Inherits from

TStream

Object which is used to hide all the nasty reading and seeking of the BDE blob data. Encapsultes it into a read-only stream.

Constructors


constructor Create(FieldNo: integer; FilterObject: TFilterObject);

***************************************************************************** ** TFILTERBLOBSTREAM Component functions/Methods/Procedures ******************************************************************************) (* ** Filter routine for reading blob fields.


Functions

destructor Destroy;

** Destructor for the FilterBlobStream object.

function Read(var Buffer; Count: Longint): Longint;

** Reads the specified amount of data from the blob field into the passed ** buffer area.

function Seek(Offset: Longint; Origin: word): Longint;

** Changes the current position pointer within the blob data by Offset amount.

function Write(const Buffer; Count: Longint): Longint;

** Stops attempts at writing to our filtered stream!

function GetBlobSize: Longint;

Reference to FilterObject

** Returns the size of the current blob field


Properties

property Position : Longint


property Size : Longint


Events

Variables

FFieldNo : integer;

Whether Blob field opened

FFilterObject : TFilterObject;

Position in Blob data

FOpened : boolean;


FPosition : Longint;

Field No in table


Constructors


constructor Create(FieldNo: integer; FilterObject: TFilterObject);

***************************************************************************** ** TFILTERBLOBSTREAM Component functions/Methods/Procedures ******************************************************************************) (* ** Filter routine for reading blob fields. These are presented as streams. ** When the GetBlobData is used, a temporary stream is created to the Fields ** Blob data (an exception occurs if the field is not a blob field). The stream ** is released before the next record is passed in by the filter mechanism. The ** previous stream is also released if the GetBlobData call is issued again in ** same filter routine. This makes it possible to check multiple blob fields ** data in the same routine. However, only ONE may be open at any one time. *) (* ** Attempts to create a stream into the blob data of the field specified. ** If successful, sets FOpened flag.


Functions


destructor Destroy;

** Destructor for the FilterBlobStream object. If the Blob data was opened ** (it may fail during the constructor), free the blob field resources.


function Read(var Buffer; Count: Longint): Longint;

** Reads the specified amount of data from the blob field into the passed ** buffer area. We need to be careful that we don't cross a segment boundary.


function Seek(Offset: Longint; Origin: word): Longint;

** Changes the current position pointer within the blob data by Offset amount. ** If Origin is: ** 0 - Offset is relative to the beginning of the blob data ** 1 - Offset is relative to the current position in the blob data ** 2 - Offset is relative to the end of the blob data


function Write(const Buffer; Count: Longint): Longint;

** Stops attempts at writing to our filtered stream!


function GetBlobSize: Longint;

Reference to FilterObject

** Returns the size of the current blob field


Properties


property Position : Longint


property Size : Longint


Events


Variables


FFieldNo : integer;

Whether Blob field opened


FFilterObject : TFilterObject;

Position in Blob data


FOpened : boolean;


FPosition : Longint;

Field No in table