M
Marcin Kalicinski
Hi,
I have a set of C-like functions for file access (like fopen, fwrite, fread,
fseek etc.). But I want to access the files using C++ stream, not these
functions. What I probably need to do is to create custom streambuf class
(am I right?).
Is there any free source code or tutorial available on how to do that? I
have googled for it, but I only found partial and untested solutions. Worse,
the solutions were pretty complicated, overriding lots of protected virtual
methods, and calling tons of acronym functions like sbumpc. I would spend
days trying to understand them and I don't have that much time.
The second question is, when I have the streambuf class how do I use it with
streams? Do I also need to create a custom iostream class that uses the
custom streambuf?
any help would be appreciated,
Marcin
I have a set of C-like functions for file access (like fopen, fwrite, fread,
fseek etc.). But I want to access the files using C++ stream, not these
functions. What I probably need to do is to create custom streambuf class
(am I right?).
Is there any free source code or tutorial available on how to do that? I
have googled for it, but I only found partial and untested solutions. Worse,
the solutions were pretty complicated, overriding lots of protected virtual
methods, and calling tons of acronym functions like sbumpc. I would spend
days trying to understand them and I don't have that much time.
The second question is, when I have the streambuf class how do I use it with
streams? Do I also need to create a custom iostream class that uses the
custom streambuf?
any help would be appreciated,
Marcin