G
Guest
I want to construct these classes derived from istream:
bz2_istream
gz_istream
png_istream
jpeg_istream (etc)
so, if I have a jpeg file I will use:
ifstream >> jpeg_istream >> (void*) raw_image_data;
If I have a bz2 file with a png image inside I will use:
ifstream >> bz2_istream >> png_istream >> (void*) raw_image_data;
Please answer these questions or (better) give me a link with a such example
It is clever to derive from istream, or it is better to create my classes from my own base class (similar to istream)?
My experience in streams is only with files, so, how can I change the data in stream? It will be done in operator>>?
Thank you
bz2_istream
gz_istream
png_istream
jpeg_istream (etc)
so, if I have a jpeg file I will use:
ifstream >> jpeg_istream >> (void*) raw_image_data;
If I have a bz2 file with a png image inside I will use:
ifstream >> bz2_istream >> png_istream >> (void*) raw_image_data;
Please answer these questions or (better) give me a link with a such example
It is clever to derive from istream, or it is better to create my classes from my own base class (similar to istream)?
My experience in streams is only with files, so, how can I change the data in stream? It will be done in operator>>?
Thank you