This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: v2 and v3 of libstdc++
On Tue, Jan 28, 2003 at 08:47:36PM +0530, Ajay Bansal wrote:
> Sorry for being oersuing it again.. I have tried to gond thru the
> discussions on filebuf::fd at
> http://gcc.gnu.org/ml/libstdc++/2001-12/msg00037.html
The current sources use a different approach again.
The replacements for the constructor taking a fd are listed here:
http://gcc.gnu.org/onlinedocs/libstdc++/ext/howto.html#2
Since GCC 3.1 you an create a stdio_filebuf from your fd, then create
an fstream that uses that stdio_filebuf as it's buffer member.
> But still, I am not able to implement corresponding functionality. As my
> application is in production & I can not change function API's, hence I
> have to have fd method. Does somebody have a patch or workaround for the
> same????
Unfortunately your code is (and always has been) non-standard and not
portable. I don't think there's any quick way to port your code to
a standard-compliant compiler and library.
When I write code targetted at GCC 2.9x and libstdc++-v2 I try to
abstract out the pieces that rely on non-standard features of the
library, so for instance call std::string::compare() through another
function, to hide the fact that libstdc++-v2 ordered the args wrong.
I hope this will make it easier to port the code to standard C++ if
the decision is made to use a different compiler.
If your API is already determined this may not be possible.
Good luck,
jon
--
"You've been orbed if you're sitting in a room and you get up to look out
the window and you suddenly realize that it was coming from the record."
- Dr. Alex Paterson