Page 1 of 1

create custom stream class

Posted: Thu Nov 30, 2017 2:12 pm
by gtafan
Since streams in wxWidgets seems to be similar to the ones from Java, I was wondering how to make a custom own stream class, like for example DESInputStream, that should decrypt DES data from some wxInputStream. Is there some examples how to do something like that?

Re: create custom stream class

Posted: Thu Nov 30, 2017 6:19 pm
by doublemax
Usually these stream classes derive from wxFilterInputStream and take a wxInputStream as input parameter.

One example would be wxZlibInputStream, its implementation is relatively small and can be seen in <wxdir>/src/common/zstream.cpp

Re: create custom stream class

Posted: Fri Dec 01, 2017 12:17 pm
by gtafan
doublemax wrote:Usually these stream classes derive from wxFilterInputStream and take a wxInputStream as input parameter.

One example would be wxZlibInputStream, its implementation is relatively small and can be seen in <wxdir>/src/common/zstream.cpp
OK, so it seems to be really similar to how it´s done in Java. Howewer in Java I have to overwrite read, posiblly some other functions, not shure since it long time ago, but do I have to overwrite some functions to create a custom wxWidgets stream? I gues I have to owerwrite read, but which one?