[fpc-devel] [PATCH] patch for zipper.pp
micha at neli.hopto.org
Wed Jul 29 10:18:27 CEST 2009
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
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
More information about the fpc-devel