create custom stream class

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

create custom stream class

Post 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?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: create custom stream class

Post 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
Use the source, Luke!
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

Re: create custom stream class

Post 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?
Post Reply