On Wed, 29 Jul 2009, Micha Nelissen wrote:

Michael Van Canneyt wrote:
The handler is called 2 times:
- Once to create the stream (aclosing=false)
- Once when the data has been written to the steam. (AClosing=true)

Maybe it had been better to create 2 events:
- OnCreateStream
- OnDestroyStream (optional, if not set the component frees the stream)

What do you think ?

Yes, that's more intuitive to me. (Also removes the need for that boolean parameter?)

Would it be allowed to do processing on OnDestroyStream? Maybe OnDoneStream or so would be even better (since that is what it means I guess, the file in the zip stream has been extracted to the specified stream in OnCreateStream?). In Delphi, in an "OnDestroy" you normally don't need to destroy the object the event is about?

Would it be allowed to re-use the same stream?
1) OnCreateStream <- MyStream
2) OnDoneStream <- write MyStream to .... but do not free it
3) OnCreateStream <- same MyStream
etc...?

I don't see why it would not be allowed, so, yes.

I'll re-implement it as proposed.

Michael.
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to