D
Dave Johnston
Hi,
I'm currently trying to create a wrapper that uses C functions but
behaves like ifstream (from fstream.h) - this is because the platform
I'm using (WinCE) doesn't support streams and this is the easiest way
to take a huge project across onto it.
Basically, I've hit a problem. I have no idea how the ifstream class
handles directories. In the code I have (which I didn't write), there
are several places whereby an ifstream stream is created with a
directory name. My wrapper simply refuses to accept a directory as the
filename - but when I do this, the project breaks.
I've tried to work it out by myself, but I'm stuck! Anyone have an
idea about the internals of fstream and how it works (I'm using VC,
but this is .c++... I'm assuming (ha!) MS didn't do anything
ridiculous)? When I do a get() on an ifstream dir it just seems to
return an empty ('space') character... and getline() does nothing, it
seems. Surely ifstream is doing something with the directory if I can
do a while([ifstream object]) loop!
Any advice would be hugely appreciated.
Dave.
I'm currently trying to create a wrapper that uses C functions but
behaves like ifstream (from fstream.h) - this is because the platform
I'm using (WinCE) doesn't support streams and this is the easiest way
to take a huge project across onto it.
Basically, I've hit a problem. I have no idea how the ifstream class
handles directories. In the code I have (which I didn't write), there
are several places whereby an ifstream stream is created with a
directory name. My wrapper simply refuses to accept a directory as the
filename - but when I do this, the project breaks.
I've tried to work it out by myself, but I'm stuck! Anyone have an
idea about the internals of fstream and how it works (I'm using VC,
but this is .c++... I'm assuming (ha!) MS didn't do anything
ridiculous)? When I do a get() on an ifstream dir it just seems to
return an empty ('space') character... and getline() does nothing, it
seems. Surely ifstream is doing something with the directory if I can
do a while([ifstream object]) loop!
Any advice would be hugely appreciated.
Dave.