Unit Filters

+----------------------------------------------------------------------------+ | İ İ | | İİ İ İ İ | | İİİ İ İ İ | | İİ İ İ İ | | İ İİ İ İ | | İ İ İİİ İİ İ | | İİ İ İ İİİİİİİİİİ İ | | İ İİ İİ İİİİİİİİİİİİİİİ | | İ İİİ İİİİİİ İİİ İ İİİİİİİİ | | İ İİ İİİİİİİİİİİİ İ İİİİİİİİİİ Copyright İ 1996-1997 by: | | İ İİİİİİ İİİİİİİİİİİ İ İİİİİ İİ | | İ İİİİİİİ İİİİİ İİİİ İİ İİ İ WHITE ANTS SYSTEMHOUSE BV | | İ İİİİİİİ İİİ İİİ İİ İ İİİİ Geleen 12 | | İ İİİİİİİ İ İİ İİİ İ 8032 GB Zwolle | | İİİİİİ İ İ İ Netherlands | | İİİ İİİİİ İ İİ İ İ | | İİ İ İ İİİ İ Tel. +31 38 453 86 31 | | İ İ İ Fax. +31 38 453 41 22 | | İ İ İİ | | İ İ İİ www.whiteants.com | | İİ İ İ İ support@whiteants.com | | İ | +----------------------------------------------------------------------------+ file : Filters version : 1.0 comment : Implements and extends the BP 7.0 Streaming mechanism in Delphi author : G. Beuze compiler : Delphi 1.0 +----------------------------------------------------------------------------+ | DISCLAIMER: | | THIS SOURCE IS FREEWARE. YOU ARE ALLOWED TO USE IT IN YOUR OWN PROJECTS | | WITHOUT ANY RESTRICTIONS. YOU ARE NOT ALLOWED TO SELL THE SOURCE CODE. | | THERE IS NO WARRANTY AT ALL - YOU USE IT ON YOUR OWN RISC. WHITE ANTS DOES | | NOT ASSUME ANY RESPONSIBILITY FOR ANY DAMAGE OR ANY LOSS OF TIME OR MONEY | | DUE THE USE OF ANY PART OF THIS SOURCE CODE. | +----------------------------------------------------------------------------+ { TFilter is a TStream descendant which add's the Put / Get object streaming capabilities to a TStream instance. TFilter does not actually read or write data but delegates this to an attached stream. This stream can be owned or not. Filters adhere to the decorator pattern. Filters can be cascaded: Filter1 => Filter2 => Filter3 => TStream. (such as TFileStream) Some additional filters are included: - BufferedFilter buffers it's IO - BufFileFilter is a combination of a TBufferedFilter with a TFileStream - TCycleFilter is a filter that is able to read and write cyclic object structures like: Parent saves children and children save their parent. - TClipBrdFilter reads and writes is a binary clipboard stream, allowing you to stream classes to the clipboard the same way you stream them to a file - TOffsetFilter which lets you treat a section in an other stream as new complete stream, including Position := 0, Size etc. Utility procedures include - Reading and writing of PChar and TStrings from/to a TFilter - Copying a TStreamable instance by first putting it to memory and then getting it back. For classes to be streamable, they MUST be a TStreamable descendant AND be registered as streamable using the RegisterStreamable procedure.

Classes

TBufferedFilter -
TBufFileStream -
TClipbrdFilter -
TCycleFilter -
TFilter -
TOffsetFilter -
TStreamable -
TStreamableClass -

Functions

CopyStreamable -
FindStreamable -
GetStreamable -
LoadPChar -
LoadStrings -
RegisterStreamable -
RegisterStreamables -
StorePChar -
StoreStrings -
UnregisterStreamables -

Types

TClipbrdFilterMode

Constants

CF_STREAMABLE
UnlimitedRange

Variables


Functions


function CopyStreamable(Instance: TStreamable): TStreamable;


function FindStreamable(const ClassName: String): TStreamableClass;


function GetStreamable(const ClassName: String): TStreamableClass;


function LoadPChar(Stream: TStream): PChar;


procedure LoadStrings(Filter: TFilter; List: TStrings);


procedure RegisterStreamable(AClass: TStreamableClass);


procedure RegisterStreamables(AClasses: array of TStreamableClass);


procedure StorePChar(Stream: TStream; Source: PChar);


procedure StoreStrings(Filter: TFilter; List: TStrings);


procedure UnregisterStreamables;


Types


TClipbrdFilterMode = (cmRead, cmWrite);
Clipboard format for streamables

Constants

CF_STREAMABLE = 0

UnlimitedRange = -1


Variables