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.
gtafan
Earned some good credits
Earned some good credits
Posts: 133
Joined: Wed Mar 29, 2017 9:52 am

create custom stream class

Postby gtafan » Thu Nov 30, 2017 2:12 pm

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: 12822
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: create custom stream class

Postby doublemax » Thu Nov 30, 2017 6:19 pm

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
Earned some good credits
Earned some good credits
Posts: 133
Joined: Wed Mar 29, 2017 9:52 am

Re: create custom stream class

Postby gtafan » Fri Dec 01, 2017 12:17 pm

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?


Return to “General Development”

Who is online

Users browsing this forum: No registered users and 6 guests