fstream and wxFile: is it the same?

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.
Post Reply
deck
Experienced Solver
Experienced Solver
Posts: 82
Joined: Fri Jul 15, 2005 10:20 am

fstream and wxFile: is it the same?

Post by deck » Mon Jan 08, 2007 5:23 pm

Hi all, I have a program that declares a file as

Code: Select all

fstream DataFile;
DataFile.open(FileName, ios::in | ios::out | ios:: trunc |
         ios::binary);
Could I have problems if I declared it like

Code: Select all

wxFile DataFile;
DataFile.Open(FileName, wxFile::read_write);
Thank you

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Tue Jan 09, 2007 8:16 am

streams and files are not similar. wxFile is derived from the file functionality in stdio.h (I believe) and streams are really a C++ STL concept, which can be emulated using wxStream and the likes. Look up these in the documentation to see what derived streams are present.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

deck
Experienced Solver
Experienced Solver
Posts: 82
Joined: Fri Jul 15, 2005 10:20 am

Post by deck » Sun Jan 14, 2007 2:04 am

yes, but the program seems to be working fine, so no problem!

krzysiek_t
Earned a small fee
Earned a small fee
Posts: 23
Joined: Tue Jul 11, 2006 1:36 pm
Location: Poland, Warsaw
Contact:

Post by krzysiek_t » Thu Feb 22, 2007 12:07 pm

Everything as expected. std::fstream and wxFile are different classes but in general they do the same. So effects are the same too.

Post Reply