3 * Silicon Graphics Computer Systems, Inc.
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
11 * Permission to use or copy this software for any purpose is hereby granted
12 * without fee, provided the above notices are retained on all copies.
13 * Permission to modify the code and to distribute modified code is granted,
14 * provided the above notices are retained, and a notice that the code was
15 * modified is included with the above copyright notice.
18 // This header defines classes basic_filebuf, basic_ifstream,
19 // basic_ofstream, and basic_fstream. These classes represent
20 // streambufs and streams whose sources or destinations are files.
22 #ifndef _STLP_INTERNAL_FSTREAM_H
23 #define _STLP_INTERNAL_FSTREAM_H
25 #if defined(__sgi) && !defined(__GNUC__) && !defined(_STANDARD_C_PLUS_PLUS)
26 # error This header file requires the -LANG:std option
29 #ifndef _STLP_INTERNAL_STREAMBUF
30 # include <stl/_streambuf.h>
33 #ifndef _STLP_INTERNAL_ISTREAM
34 # include <stl/_istream.h>
37 #ifndef _STLP_INTERNAL_CODECVT_H
38 # include <stl/_codecvt.h>
41 #if !defined (_STLP_USE_UNIX_IO) && !defined(_STLP_USE_WIN32_IO) && \
42 !defined (_STLP_USE_UNIX_EMULATION_IO) && !defined (_STLP_USE_STDIO_IO)
44 # if defined (_STLP_UNIX) || defined (__CYGWIN__) || defined (__amigaos__) || defined (__EMX__)
45 // open/close/read/write
46 # define _STLP_USE_UNIX_IO
47 # elif defined (_STLP_WIN32)
48 // CreateFile/ReadFile/WriteFile
49 # define _STLP_USE_WIN32_IO
50 # elif defined (_STLP_WIN16) || defined (_STLP_MAC)
52 # define _STLP_USE_UNIX_EMULATION_IO
55 # define _STLP_USE_STDIO_IO
56 # endif /* _STLP_UNIX */
57 #endif /* mode selection */
59 #if defined (_STLP_USE_WIN32_IO)
60 typedef void* _STLP_fd;
61 #elif defined (_STLP_USE_UNIX_EMULATION_IO) || defined (_STLP_USE_STDIO_IO) || defined (_STLP_USE_UNIX_IO)
64 # error "Configure i/o !"
69 //----------------------------------------------------------------------
70 // Class _Filebuf_base, a private base class to factor out the system-
71 // dependent code from basic_filebuf<>.
73 class _STLP_CLASS_DECLSPEC _Filebuf_base {
74 public: // Opening and closing files.
77 bool _M_open(const char*, ios_base::openmode, long __protection);
78 bool _M_open(const char*, ios_base::openmode);
79 bool _M_open(int __id, ios_base::openmode = ios_base::__default_mode);
80 #if defined (_STLP_USE_WIN32_IO)
81 bool _M_open(_STLP_fd __id, ios_base::openmode = ios_base::__default_mode);
82 #endif /* _STLP_USE_WIN32_IO */
85 public: // Low-level I/O, like Unix read/write
86 ptrdiff_t _M_read(char* __buf, ptrdiff_t __n);
87 streamoff _M_seek(streamoff __offset, ios_base::seekdir __dir);
88 streamoff _M_file_size();
89 bool _M_write(char* __buf, ptrdiff_t __n);
91 public: // Memory-mapped I/O.
92 void* _M_mmap(streamoff __offset, streamoff __len);
93 void _M_unmap(void* __mmap_base, streamoff __len);
96 // Returns a value n such that, if pos is the file pointer at the
97 // beginning of the range [first, last), pos + n is the file pointer at
98 // the end. On many operating systems n == __last - __first.
99 // In Unix, writing n characters always bumps the file position by n.
100 // In Windows text mode, however, it bumps the file position by n + m,
101 // where m is the number of newlines in the range. That's because an
102 // internal \n corresponds to an external two-character sequence.
103 streamoff _M_get_offset(char* __first, char* __last) {
104 #if defined (_STLP_UNIX) || defined (_STLP_MAC)
105 return __last - __first;
106 #else // defined (_STLP_WIN32) || defined (_STLP_WIN16) || defined (_STLP_DOS) || defined(N_PLAT_NLM)
107 return ( (_M_openmode & ios_base::binary) != 0 )
109 : count(__first, __last, '\n') + (__last - __first);
113 // Returns true if we're in binary mode or if we're using an OS or file
114 // system where there is no distinction between text and binary mode.
115 bool _M_in_binary_mode() const {
116 #if defined (_STLP_UNIX) || defined (_STLP_MAC) || defined(__BEOS__) || defined (__amigaos__)
118 #elif defined (_STLP_WIN32) || defined (_STLP_WIN16) || defined (_STLP_DOS) || defined (_STLP_VM) || defined (__EMX__) || defined(N_PLAT_NLM)
119 return (_M_openmode & ios_base::binary) != 0;
125 static void _S_initialize();
127 protected: // Static data members.
128 static size_t _M_page_size;
130 protected: // Data members.
132 #if defined (_STLP_USE_STDIO_IO)
133 // for stdio, the whole FILE* is being kept here
136 #if defined (_STLP_USE_WIN32_IO)
140 ios_base::openmode _M_openmode ;
141 unsigned char _M_is_open ;
142 unsigned char _M_should_close ;
143 unsigned char _M_regular_file ;
146 static size_t _STLP_CALL __page_size() { return _M_page_size; }
147 int __o_mode() const { return (int)_M_openmode; }
148 bool __is_open() const { return (_M_is_open !=0 ); }
149 bool __should_close() const { return (_M_should_close != 0); }
150 bool __regular_file() const { return (_M_regular_file != 0); }
151 _STLP_fd __get_fd() const { return _M_file_id; }
154 //----------------------------------------------------------------------
155 // Class basic_filebuf<>.
157 // Forward declaration of two helper classes.
158 template <class _Traits> class _Noconv_input;
160 class _Noconv_input<char_traits<char> >;
162 template <class _Traits> class _Noconv_output;
164 class _Noconv_output< char_traits<char> >;
166 // There is a specialized version of underflow, for basic_filebuf<char>,
169 template <class _CharT, class _Traits>
172 _STLP_TEMPLATE_NULL class _Underflow< char, char_traits<char> >;
174 template <class _CharT, class _Traits>
175 class basic_filebuf : public basic_streambuf<_CharT, _Traits> {
177 typedef _CharT char_type;
178 typedef typename _Traits::int_type int_type;
179 typedef typename _Traits::pos_type pos_type;
180 typedef typename _Traits::off_type off_type;
181 typedef _Traits traits_type;
183 typedef typename _Traits::state_type _State_type;
184 typedef basic_streambuf<_CharT, _Traits> _Base;
185 typedef basic_filebuf<_CharT, _Traits> _Self;
187 public: // Constructors, destructor.
191 public: // Opening and closing files.
192 bool is_open() const { return _M_base.__is_open(); }
194 _Self* open(const char* __s, ios_base::openmode __m) {
195 return _M_base._M_open(__s, __m) ? this : 0;
198 #if !defined (_STLP_NO_EXTENSIONS)
199 // These two version of open() and file descriptor getter are extensions.
200 _Self* open(const char* __s, ios_base::openmode __m,
202 return _M_base._M_open(__s, __m, __protection) ? this : 0;
205 _STLP_fd fd() const { return _M_base.__get_fd(); }
207 _Self* open(int __id, ios_base::openmode _Init_mode = ios_base::__default_mode) {
208 return this->_M_open(__id, _Init_mode);
211 # if defined (_STLP_USE_WIN32_IO)
212 _Self* open(_STLP_fd __id, ios_base::openmode _Init_mode = ios_base::__default_mode) {
213 return _M_base._M_open(__id, _Init_mode) ? this : 0;
215 # endif /* _STLP_USE_WIN32_IO */
219 _Self* _M_open(int __id, ios_base::openmode _Init_mode = ios_base::__default_mode) {
220 return _M_base._M_open(__id, _Init_mode) ? this : 0;
225 protected: // Virtual functions from basic_streambuf.
226 virtual streamsize showmanyc();
227 virtual int_type underflow();
229 virtual int_type pbackfail(int_type = traits_type::eof());
230 virtual int_type overflow(int_type = traits_type::eof());
232 virtual basic_streambuf<_CharT, _Traits>* setbuf(char_type*, streamsize);
233 virtual pos_type seekoff(off_type, ios_base::seekdir,
234 ios_base::openmode = ios_base::in | ios_base::out);
235 virtual pos_type seekpos(pos_type,
236 ios_base::openmode = ios_base::in | ios_base::out);
239 virtual void imbue(const locale&);
241 private: // Helper functions.
243 // Precondition: we are currently in putback input mode. Effect:
244 // switches back to ordinary input mode.
245 void _M_exit_putback_mode() {
246 this->setg(_M_saved_eback, _M_saved_gptr, _M_saved_egptr);
247 _M_in_putback_mode = false;
249 bool _M_switch_to_input_mode();
250 void _M_exit_input_mode();
251 bool _M_switch_to_output_mode();
253 int_type _M_input_error();
254 int_type _M_underflow_aux();
255 // friend class _Noconv_input<_Traits>;
256 // friend class _Noconv_output<_Traits>;
257 friend class _Underflow<_CharT, _Traits>;
259 int_type _M_output_error();
262 bool _M_allocate_buffers(_CharT* __buf, streamsize __n);
263 bool _M_allocate_buffers();
264 void _M_deallocate_buffers();
266 pos_type _M_seek_return(off_type __off, _State_type __state) {
268 if (_M_in_input_mode)
269 _M_exit_input_mode();
270 _M_in_input_mode = false;
271 _M_in_output_mode = false;
272 _M_in_putback_mode = false;
273 _M_in_error_mode = false;
278 pos_type __result(__off);
279 __result.state(__state);
283 bool _M_seek_init(bool __do_unshift);
285 void _M_setup_codecvt(const locale&, bool __on_imbue = true);
287 private: // Data members used in all modes.
289 _Filebuf_base _M_base;
291 private: // Locale-related information.
293 unsigned char _M_constant_width;
294 unsigned char _M_always_noconv;
296 // private: // Mode flags.
297 unsigned char _M_int_buf_dynamic; // True if internal buffer is heap allocated,
298 // false if it was supplied by the user.
299 unsigned char _M_in_input_mode;
300 unsigned char _M_in_output_mode;
301 unsigned char _M_in_error_mode;
302 unsigned char _M_in_putback_mode;
304 // Internal buffer: characters seen by the filebuf's clients.
306 _CharT* _M_int_buf_EOS;
308 // External buffer: characters corresponding to the external file.
310 char* _M_ext_buf_EOS;
312 // The range [_M_ext_buf, _M_ext_buf_converted) contains the external
313 // characters corresponding to the sequence in the internal buffer. The
314 // range [_M_ext_buf_converted, _M_ext_buf_end) contains characters that
315 // have been read into the external buffer but have not been converted
316 // to an internal sequence.
317 char* _M_ext_buf_converted;
318 char* _M_ext_buf_end;
320 // State corresponding to beginning of internal buffer.
321 _State_type _M_state;
323 private: // Data members used only in input mode.
325 // Similar to _M_state except that it corresponds to
326 // the end of the internal buffer instead of the beginning.
327 _State_type _M_end_state;
329 // This is a null pointer unless we are in mmap input mode.
331 streamoff _M_mmap_len;
333 private: // Data members used only in putback mode.
334 _CharT* _M_saved_eback;
335 _CharT* _M_saved_gptr;
336 _CharT* _M_saved_egptr;
338 typedef codecvt<_CharT, char, _State_type> _Codecvt;
339 const _Codecvt* _M_codecvt;
341 int _M_width; // Width of the encoding (if constant), else 1
342 int _M_max_width; // Largest possible width of single character.
345 enum { _S_pback_buf_size = 8 };
346 _CharT _M_pback_buf[_S_pback_buf_size];
348 // for _Noconv_output
350 bool _M_write(char* __buf, ptrdiff_t __n) {return _M_base._M_write(__buf, __n); }
354 _M_do_noconv_input() {
355 _M_ext_buf_converted = _M_ext_buf_end;
356 /* this-> */ _Base::setg((char_type*)_M_ext_buf, (char_type*)_M_ext_buf, (char_type*)_M_ext_buf_end);
357 return traits_type::to_int_type(*_M_ext_buf);
361 #if defined (_STLP_USE_TEMPLATE_EXPORT)
362 _STLP_EXPORT_TEMPLATE_CLASS basic_filebuf<char, char_traits<char> >;
363 # if ! defined (_STLP_NO_WCHAR_T)
364 _STLP_EXPORT_TEMPLATE_CLASS basic_filebuf<wchar_t, char_traits<wchar_t> >;
366 #endif /* _STLP_USE_TEMPLATE_EXPORT */
370 template <class _CharT>
371 struct _Filebuf_Tmp_Buf {
373 _Filebuf_Tmp_Buf(ptrdiff_t __n) : _M_ptr(0) { _M_ptr = new _CharT[__n]; }
374 ~_Filebuf_Tmp_Buf() { delete[] _M_ptr; }
379 // This class had to be designed very carefully to work
382 template <class _Traits>
383 class _Noconv_output {
385 typedef typename _Traits::char_type char_type;
386 static bool _STLP_CALL _M_doit(basic_filebuf<char_type, _Traits >*,
387 char_type*, char_type*)
392 class _STLP_CLASS_DECLSPEC _Noconv_output< char_traits<char> > {
394 static bool _STLP_CALL
395 _M_doit(basic_filebuf<char, char_traits<char> >* __buf,
396 char* __first, char* __last) {
397 ptrdiff_t __n = __last - __first;
398 return (__buf->_M_write(__first, __n));
402 //----------------------------------------------------------------------
403 // basic_filebuf<> helper functions.
406 //----------------------------------------
407 // Helper functions for switching between modes.
410 // This class had to be designed very carefully to work
413 template <class _Traits>
414 class _Noconv_input {
416 typedef typename _Traits::int_type int_type;
417 typedef typename _Traits::char_type char_type;
419 static inline int_type _STLP_CALL
420 _M_doit(basic_filebuf<char_type, _Traits>*)
421 { return _Traits::eof(); }
425 class _Noconv_input<char_traits<char> > {
427 static inline int _STLP_CALL
428 _M_doit(basic_filebuf<char, char_traits<char> >* __buf) {
429 return __buf->_M_do_noconv_input();
433 // underflow() may be called for one of two reasons. (1) We've
434 // been going through the special putback buffer, and we need to move back
435 // to the regular internal buffer. (2) We've exhausted the internal buffer,
436 // and we need to replentish it.
437 template <class _CharT, class _Traits>
440 typedef typename _Traits::int_type int_type;
441 typedef _Traits traits_type;
443 static int_type _STLP_CALL _M_doit(basic_filebuf<_CharT, _Traits>* __this);
447 // Specialization of underflow: if the character type is char, maybe
448 // we can use mmap instead of read.
450 class _STLP_CLASS_DECLSPEC _Underflow< char, char_traits<char> > {
452 typedef char_traits<char>::int_type int_type;
453 typedef char_traits<char> traits_type;
454 static int _STLP_CALL _M_doit(basic_filebuf<char, traits_type >* __this);
457 // There is a specialized version of underflow, for basic_filebuf<char>,
460 template <class _CharT, class _Traits>
461 _STLP_TYPENAME_ON_RETURN_TYPE _Underflow<_CharT, _Traits>::int_type // _STLP_CALL
462 _Underflow<_CharT, _Traits>::_M_doit(basic_filebuf<_CharT, _Traits>* __this) {
463 if (!__this->_M_in_input_mode) {
464 if (!__this->_M_switch_to_input_mode())
465 return traits_type::eof();
467 else if (__this->_M_in_putback_mode) {
468 __this->_M_exit_putback_mode();
469 if (__this->gptr() != __this->egptr()) {
470 int_type __c = traits_type::to_int_type(*__this->gptr());
475 return __this->_M_underflow_aux();
478 #if defined (_STLP_USE_TEMPLATE_EXPORT) && !defined (_STLP_NO_WCHAR_T)
479 _STLP_EXPORT_TEMPLATE_CLASS _Underflow<wchar_t, char_traits<wchar_t> >;
482 //----------------------------------------------------------------------
483 // Class basic_ifstream<>
485 template <class _CharT, class _Traits>
486 class basic_ifstream : public basic_istream<_CharT, _Traits> {
488 typedef _CharT char_type;
489 typedef typename _Traits::int_type int_type;
490 typedef typename _Traits::pos_type pos_type;
491 typedef typename _Traits::off_type off_type;
492 typedef _Traits traits_type;
494 typedef basic_ios<_CharT, _Traits> _Basic_ios;
495 typedef basic_istream<_CharT, _Traits> _Base;
496 typedef basic_filebuf<_CharT, _Traits> _Buf;
498 public: // Constructors, destructor.
501 basic_ios<_CharT, _Traits>(), basic_istream<_CharT, _Traits>(0), _M_buf() {
505 explicit basic_ifstream(const char* __s, ios_base::openmode __mod = ios_base::in) :
506 basic_ios<_CharT, _Traits>(), basic_istream<_CharT, _Traits>(0),
509 if (!_M_buf.open(__s, __mod | ios_base::in))
510 this->setstate(ios_base::failbit);
513 #if !defined (_STLP_NO_EXTENSIONS)
514 explicit basic_ifstream(int __id, ios_base::openmode __mod = ios_base::in) :
515 basic_ios<_CharT, _Traits>(), basic_istream<_CharT, _Traits>(0), _M_buf() {
517 if (!_M_buf.open(__id, __mod | ios_base::in))
518 this->setstate(ios_base::failbit);
520 basic_ifstream(const char* __s, ios_base::openmode __m,
522 basic_ios<_CharT, _Traits>(), basic_istream<_CharT, _Traits>(0), _M_buf() {
524 if (!_M_buf.open(__s, __m | ios_base::in, __protection))
525 this->setstate(ios_base::failbit);
528 # if defined (_STLP_USE_WIN32_IO)
529 explicit basic_ifstream(_STLP_fd __id, ios_base::openmode __mod = ios_base::in) :
530 basic_ios<_CharT, _Traits>(), basic_istream<_CharT, _Traits>(0), _M_buf() {
532 if (!_M_buf.open(__id, __mod | ios_base::in))
533 this->setstate(ios_base::failbit);
535 # endif /* _STLP_USE_WIN32_IO */
540 public: // File and buffer operations.
541 basic_filebuf<_CharT, _Traits>* rdbuf() const
542 { return __CONST_CAST(_Buf*,&_M_buf); }
545 return this->rdbuf()->is_open();
548 void open(const char* __s, ios_base::openmode __mod = ios_base::in) {
549 if (!this->rdbuf()->open(__s, __mod | ios_base::in))
550 this->setstate(ios_base::failbit);
554 if (!this->rdbuf()->close())
555 this->setstate(ios_base::failbit);
559 basic_filebuf<_CharT, _Traits> _M_buf;
563 //----------------------------------------------------------------------
564 // Class basic_ofstream<>
566 template <class _CharT, class _Traits>
567 class basic_ofstream : public basic_ostream<_CharT, _Traits> {
569 typedef _CharT char_type;
570 typedef typename _Traits::int_type int_type;
571 typedef typename _Traits::pos_type pos_type;
572 typedef typename _Traits::off_type off_type;
573 typedef _Traits traits_type;
575 typedef basic_ios<_CharT, _Traits> _Basic_ios;
576 typedef basic_ostream<_CharT, _Traits> _Base;
577 typedef basic_filebuf<_CharT, _Traits> _Buf;
579 public: // Constructors, destructor.
581 basic_ios<_CharT, _Traits>(),
582 basic_ostream<_CharT, _Traits>(0), _M_buf() {
585 explicit basic_ofstream(const char* __s, ios_base::openmode __mod = ios_base::out)
586 : basic_ios<_CharT, _Traits>(), basic_ostream<_CharT, _Traits>(0), _M_buf() {
588 if (!_M_buf.open(__s, __mod | ios_base::out))
589 this->setstate(ios_base::failbit);
592 #if !defined (_STLP_NO_EXTENSIONS)
593 explicit basic_ofstream(int __id, ios_base::openmode __mod = ios_base::out)
594 : basic_ios<_CharT, _Traits>(), basic_ostream<_CharT, _Traits>(0),
597 if (!_M_buf.open(__id, __mod | ios_base::out))
598 this->setstate(ios_base::failbit);
600 basic_ofstream(const char* __s, ios_base::openmode __m, long __protection) :
601 basic_ios<_CharT, _Traits>(), basic_ostream<_CharT, _Traits>(0), _M_buf() {
603 if (!_M_buf.open(__s, __m | ios_base::out, __protection))
604 this->setstate(ios_base::failbit);
606 # if defined (_STLP_USE_WIN32_IO)
607 explicit basic_ofstream(_STLP_fd __id, ios_base::openmode __mod = ios_base::out)
608 : basic_ios<_CharT, _Traits>(), basic_ostream<_CharT, _Traits>(0),
611 if (!_M_buf.open(__id, __mod | ios_base::out))
612 this->setstate(ios_base::failbit);
614 # endif /* _STLP_USE_WIN32_IO */
619 public: // File and buffer operations.
620 basic_filebuf<_CharT, _Traits>* rdbuf() const
621 { return __CONST_CAST(_Buf*,&_M_buf); }
624 return this->rdbuf()->is_open();
627 void open(const char* __s, ios_base::openmode __mod= ios_base::out) {
628 if (!this->rdbuf()->open(__s, __mod | ios_base::out))
629 this->setstate(ios_base::failbit);
633 if (!this->rdbuf()->close())
634 this->setstate(ios_base::failbit);
638 basic_filebuf<_CharT, _Traits> _M_buf;
642 //----------------------------------------------------------------------
643 // Class basic_fstream<>
645 template <class _CharT, class _Traits>
646 class basic_fstream : public basic_iostream<_CharT, _Traits> {
648 typedef _CharT char_type;
649 typedef typename _Traits::int_type int_type;
650 typedef typename _Traits::pos_type pos_type;
651 typedef typename _Traits::off_type off_type;
652 typedef _Traits traits_type;
654 typedef basic_ios<_CharT, _Traits> _Basic_ios;
655 typedef basic_iostream<_CharT, _Traits> _Base;
656 typedef basic_filebuf<_CharT, _Traits> _Buf;
658 public: // Constructors, destructor.
661 : basic_ios<_CharT, _Traits>(), basic_iostream<_CharT, _Traits>(0), _M_buf() {
665 explicit basic_fstream(const char* __s,
666 ios_base::openmode __mod = ios_base::in | ios_base::out) :
667 basic_ios<_CharT, _Traits>(), basic_iostream<_CharT, _Traits>(0), _M_buf() {
669 if (!_M_buf.open(__s, __mod))
670 this->setstate(ios_base::failbit);
673 #if !defined (_STLP_NO_EXTENSIONS)
674 explicit basic_fstream(int __id,
675 ios_base::openmode __mod = ios_base::in | ios_base::out) :
676 basic_ios<_CharT, _Traits>(), basic_iostream<_CharT, _Traits>(0), _M_buf() {
678 if (!_M_buf.open(__id, __mod))
679 this->setstate(ios_base::failbit);
681 basic_fstream(const char* __s, ios_base::openmode __m, long __protection) :
682 basic_ios<_CharT, _Traits>(), basic_iostream<_CharT, _Traits>(0), _M_buf() {
684 if (!_M_buf.open(__s, __m, __protection))
685 this->setstate(ios_base::failbit);
687 # if defined (_STLP_USE_WIN32_IO)
688 explicit basic_fstream(_STLP_fd __id,
689 ios_base::openmode __mod = ios_base::in | ios_base::out) :
690 basic_ios<_CharT, _Traits>(), basic_iostream<_CharT, _Traits>(0), _M_buf() {
692 if (!_M_buf.open(__id, __mod))
693 this->setstate(ios_base::failbit);
695 # endif /* _STLP_USE_WIN32_IO */
699 public: // File and buffer operations.
701 basic_filebuf<_CharT, _Traits>* rdbuf() const
702 { return __CONST_CAST(_Buf*,&_M_buf); }
705 return this->rdbuf()->is_open();
708 void open(const char* __s,
709 ios_base::openmode __mod =
710 ios_base::in | ios_base::out) {
711 if (!this->rdbuf()->open(__s, __mod))
712 this->setstate(ios_base::failbit);
716 if (!this->rdbuf()->close())
717 this->setstate(ios_base::failbit);
721 basic_filebuf<_CharT, _Traits> _M_buf;
723 #if defined (_STLP_MSVC) && (_STLP_MSVC >= 1300 && _STLP_MSVC <= 1310)
724 typedef basic_fstream<_CharT, _Traits> _Self;
725 //explicitely defined as private to avoid warnings:
726 basic_fstream(_Self const&);
727 _Self& operator = (_Self const&);
733 #if defined (_STLP_EXPOSE_STREAM_IMPLEMENTATION) && !defined (_STLP_LINK_TIME_INSTANTIATION)
734 # include <stl/_fstream.c>
737 _STLP_BEGIN_NAMESPACE
739 #if defined (_STLP_USE_TEMPLATE_EXPORT)
740 _STLP_EXPORT_TEMPLATE_CLASS basic_ifstream<char, char_traits<char> >;
741 _STLP_EXPORT_TEMPLATE_CLASS basic_ofstream<char, char_traits<char> >;
742 _STLP_EXPORT_TEMPLATE_CLASS basic_fstream<char, char_traits<char> >;
743 # if ! defined (_STLP_NO_WCHAR_T)
744 _STLP_EXPORT_TEMPLATE_CLASS basic_ifstream<wchar_t, char_traits<wchar_t> >;
745 _STLP_EXPORT_TEMPLATE_CLASS basic_ofstream<wchar_t, char_traits<wchar_t> >;
746 _STLP_EXPORT_TEMPLATE_CLASS basic_fstream<wchar_t, char_traits<wchar_t> >;
748 #endif /* _STLP_USE_TEMPLATE_EXPORT */
752 #endif /* _STLP_FSTREAM */