Topic: wofstream


Author: "Hubert.Holin" <hubert.holin@meteo.fr>
Date: 1998/11/14
Raw View
Somwhere in the E.U., le 13/11/1998

[followups to csc++ only]

Valentin Bonnard wrote:

[SNIP]

> Yes, wide-stream vs ordinary-stream and wide-file-names
> vs ordinary-file-names are orthogonal issues.
>
> > The reason ? Probably because wide character file names
> > are not prevalent on any of the major OS s so the iostream implementation
> > does not have support for them.
>
> Win NT, which, AFAIK handles Unicode, trikes me as a
> counter-example.

[SNIP]

 So does MacOS (at various levels of implementation, ass usual).

  Hubert Holin
  Hubert.Holin@Bigfoot.com
  http://www.bigfoot.com/~Hubert.Holin
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: Valentin Bonnard <bonnardv@pratique.fr>
Date: 1998/11/12
Raw View
Edward Diener wrote:

> Wofstream deals with files containing wide characters, not file names of
wide
> characters. None of the fstream family of iostream classes specify file
names
> of wide characters.

Yes, wide-stream vs ordinary-stream and wide-file-names
vs ordinary-file-names are orthogonal issues.

> The reason ? Probably because wide character file names
> are not prevalent on any of the major OS s so the iostream implementation
> does not have support for them.

Win NT, which, AFAIK handles Unicode, trikes me as a
counter-example.

--

Valentin Bonnard                mailto:bonnardv@pratique.fr
info about C++/a propos du C++: http://pages.pratique.fr/~bonnardv/

      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: David R Tribble <david.tribble@noSPAM.central.beasys.com>
Date: 1998/11/12
Raw View
Paul Grealish wrote:
>> 'wofstream' is defined in the standard as:
>> typedef basic_ofstream<wchar_t, char_traits<wchar_t> > wofstream;
>>
>> 'basic_ofstream' defines method 'open' as:
>> void open(const char *s,
>>           ios_base::openmode mode = ios_base::out | ios_base::trunc);
>>
>> Could anyone tell me why is there no version of 'open'
>> that accepts a wide character (wchar_t*) filename?

Edward Diener wrote:
> Wofstream deals with files containing wide characters, not file names
> of wide characters. None of the fstream family of iostream classes
> specify file names of wide characters.

Correct.

> The reason? Probably because
> wide character file names are not prevalent on any of the major OSs
> so the iostream implementation does not have support for them.

Wide filenames are supported by Win32 (Microsoft Windows 95 and NT),
which I think qualifies as a "prevalent" OS.  You would think that
Microsoft would provide an (overloaded) 'open(const wchar_t *s,...)'
function, but apparently they do not.  They do, however, provide
the CreateFileW() function in their Win32 API (in <winbase.h>),
which handles wide-char filenames.

It would be nice if ISO C++ provided an overloaded 'open()'
function for wide-char filenames, though.  Since it doesn't, we
are forced into calling nonstandard implementation-specific
functions.

There ought to be a solid relationship between '::main(int argc,
wchar_t **argv)' and the uses of argv strings, namely specifying
filenames to be opened or created.

-- David R. Tribble, dtribble@technologist.com --

      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: Edward Diener <eddielee@abraxis.com>
Date: 1998/11/10
Raw View
Wofstream deals with files containing wide characters, not file names of wide
characters. None of the fstream family of iostream classes specify file names
of wide characters. The reason ? Probably because wide character file names
are not prevalent on any of the major OS s so the iostream implementation
does not have support for them.

Paul Grealish wrote:

> 'wofstream' is defined in the standard as:
> typedef basic_ofstream<wchar_t, char_traits<wchar_t> > wofstream;
>
> 'basic_ofstream' defines method 'open' as:
> void open(const char *s,
>           ios_base::openmode mode = ios_base::out | ios_base::trunc);
>
> Could anyone tell me why is there no version of 'open'
> that accepts a wide character (wchar_t*) filename?



[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: Paul Grealish <paul.grealish@uk.geopak-tms.com>
Date: 1998/11/06
Raw View
'wofstream' is defined in the standard as:
typedef basic_ofstream<wchar_t, char_traits<wchar_t> > wofstream;

'basic_ofstream' defines method 'open' as:
void open(const char *s,
          ios_base::openmode mode = ios_base::out | ios_base::trunc);

Could anyone tell me why is there no version of 'open'
that accepts a wide character (wchar_t*) filename?

--
+---------------------------------+
|         Paul Grealish           |
|       GEOPAK-TMS Limited        |
|       Cambridge, England        |
| paul.grealish@uk.geopak-tms.com |
+---------------------------------+
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]