1 // boost/filesystem/fstream.hpp --------------------------------------------//
\r
3 // Copyright Beman Dawes 2002.
\r
4 // Use, modification, and distribution is subject to the Boost Software
\r
5 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
\r
6 // http://www.boost.org/LICENSE_1_0.txt)
\r
8 // See library home page at http://www.boost.org/libs/filesystem
\r
10 //----------------------------------------------------------------------------//
\r
12 #ifndef BOOST_FILESYSTEM_FSTREAM_HPP
\r
13 #define BOOST_FILESYSTEM_FSTREAM_HPP
\r
15 #include <boost/filesystem/operations.hpp> // for 8.3 hack (see below)
\r
16 #include <boost/utility/enable_if.hpp>
\r
17 #include <boost/detail/workaround.hpp>
\r
22 #include <boost/config/abi_prefix.hpp> // must be the last #include
\r
24 // NOTE: fstream.hpp for Boost 1.32.0 and earlier supplied workarounds for
\r
25 // various compiler problems. They have been removed to ease development of the
\r
26 // basic i18n functionality. Once the new interface is stable, the workarounds
\r
27 // will be reinstated for any compilers that otherwise can support the rest of
\r
28 // the library after internationalization.
\r
32 namespace filesystem
\r
36 # if defined(BOOST_WINDOWS_API) && !defined(BOOST_FILESYSTEM_NARROW_ONLY)
\r
37 # if !defined(BOOST_DINKUMWARE_STDLIB) || BOOST_DINKUMWARE_STDLIB < 405
\r
39 // C++98 does not supply a wchar_t open, so try to get an equivalent
\r
40 // narrow char name based on the short, so-called 8.3, name.
\r
41 // Not needed for Dinkumware 405 and later as they do supply wchar_t open.
\r
42 BOOST_FILESYSTEM_DECL bool create_file_api( const std::wstring & ph,
\r
43 std::ios_base::openmode mode ); // true if succeeds
\r
44 BOOST_FILESYSTEM_DECL std::string narrow_path_api(
\r
45 const std::wstring & ph ); // return is empty if fails
\r
47 inline std::string path_proxy( const std::wstring & file_ph,
\r
48 std::ios_base::openmode mode )
\r
49 // Return a non-existant path if cannot supply narrow short path.
\r
50 // An empty path doesn't work because some Dinkumware versions
\r
51 // assert the path is non-empty.
\r
53 std::string narrow_ph;
\r
54 bool created_file( false );
\r
55 if ( !exists( file_ph )
\r
56 && (mode & std::ios_base::out) != 0
\r
57 && create_file_api( file_ph, mode ) )
\r
59 created_file = true;
\r
61 narrow_ph = narrow_path_api( file_ph );
\r
62 if ( narrow_ph.empty() )
\r
64 if ( created_file ) remove_api( file_ph );
\r
70 // Dinkumware 405 and later does supply wchar_t functions
\r
71 inline const std::wstring & path_proxy( const std::wstring & file_ph,
\r
72 std::ios_base::openmode )
\r
77 inline const std::string & path_proxy( const std::string & file_ph,
\r
78 std::ios_base::openmode )
\r
81 } // namespace detail
\r
83 template < class charT, class traits = std::char_traits<charT> >
\r
84 class basic_filebuf : public std::basic_filebuf<charT,traits>
\r
86 private: // disallow copying
\r
87 basic_filebuf( const basic_filebuf & );
\r
88 const basic_filebuf & operator=( const basic_filebuf & );
\r
91 virtual ~basic_filebuf() {}
\r
93 # ifndef BOOST_FILESYSTEM_NARROW_ONLY
\r
94 template<class Path>
\r
95 typename boost::enable_if<is_basic_path<Path>,
\r
96 basic_filebuf<charT,traits> *>::type
\r
97 open( const Path & file_ph, std::ios_base::openmode mode );
\r
99 basic_filebuf<charT,traits> *
\r
100 open( const wpath & file_ph, std::ios_base::openmode mode );
\r
103 # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
\r
104 basic_filebuf<charT,traits> *
\r
105 open( const path & file_ph, std::ios_base::openmode mode );
\r
109 template < class charT, class traits = std::char_traits<charT> >
\r
110 class basic_ifstream : public std::basic_ifstream<charT,traits>
\r
112 private: // disallow copying
\r
113 basic_ifstream( const basic_ifstream & );
\r
114 const basic_ifstream & operator=( const basic_ifstream & );
\r
116 basic_ifstream() {}
\r
118 // use two signatures, rather than one signature with default second
\r
119 // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
\r
121 # ifndef BOOST_FILESYSTEM_NARROW_ONLY
\r
122 template<class Path>
\r
123 explicit basic_ifstream( const Path & file_ph,
\r
124 typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
\r
126 template<class Path>
\r
127 basic_ifstream( const Path & file_ph, std::ios_base::openmode mode,
\r
128 typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
\r
130 template<class Path>
\r
131 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
132 open( const Path & file_ph );
\r
134 template<class Path>
\r
135 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
136 open( const Path & file_ph, std::ios_base::openmode mode );
\r
138 explicit basic_ifstream( const wpath & file_ph );
\r
139 basic_ifstream( const wpath & file_ph, std::ios_base::openmode mode );
\r
140 void open( const wpath & file_ph );
\r
141 void open( const wpath & file_ph, std::ios_base::openmode mode );
\r
144 explicit basic_ifstream( const path & file_ph );
\r
145 basic_ifstream( const path & file_ph, std::ios_base::openmode mode );
\r
146 # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
\r
147 void open( const path & file_ph );
\r
148 void open( const path & file_ph, std::ios_base::openmode mode );
\r
150 virtual ~basic_ifstream() {}
\r
153 template < class charT, class traits = std::char_traits<charT> >
\r
154 class basic_ofstream : public std::basic_ofstream<charT,traits>
\r
156 private: // disallow copying
\r
157 basic_ofstream( const basic_ofstream & );
\r
158 const basic_ofstream & operator=( const basic_ofstream & );
\r
160 basic_ofstream() {}
\r
162 // use two signatures, rather than one signature with default second
\r
163 // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
\r
165 # ifndef BOOST_FILESYSTEM_NARROW_ONLY
\r
167 template<class Path>
\r
168 explicit basic_ofstream( const Path & file_ph,
\r
169 typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
\r
170 explicit basic_ofstream( const wpath & file_ph );
\r
172 template<class Path>
\r
173 basic_ofstream( const Path & file_ph, std::ios_base::openmode mode,
\r
174 typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
\r
175 basic_ofstream( const wpath & file_ph, std::ios_base::openmode mode );
\r
177 template<class Path>
\r
178 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
179 open( const Path & file_ph );
\r
180 void open( const wpath & file_ph );
\r
182 template<class Path>
\r
183 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
184 open( const Path & file_ph, std::ios_base::openmode mode );
\r
185 void open( const wpath & file_ph, std::ios_base::openmode mode );
\r
189 explicit basic_ofstream( const path & file_ph );
\r
190 basic_ofstream( const path & file_ph, std::ios_base::openmode mode );
\r
191 # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
\r
192 void open( const path & file_ph );
\r
193 void open( const path & file_ph, std::ios_base::openmode mode );
\r
195 virtual ~basic_ofstream() {}
\r
198 template < class charT, class traits = std::char_traits<charT> >
\r
199 class basic_fstream : public std::basic_fstream<charT,traits>
\r
201 private: // disallow copying
\r
202 basic_fstream( const basic_fstream & );
\r
203 const basic_fstream & operator=( const basic_fstream & );
\r
207 // use two signatures, rather than one signature with default second
\r
208 // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
\r
210 # ifndef BOOST_FILESYSTEM_NARROW_ONLY
\r
212 template<class Path>
\r
213 explicit basic_fstream( const Path & file_ph,
\r
214 typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
\r
215 explicit basic_fstream( const wpath & file_ph );
\r
217 template<class Path>
\r
218 basic_fstream( const Path & file_ph, std::ios_base::openmode mode,
\r
219 typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
\r
220 basic_fstream( const wpath & file_ph, std::ios_base::openmode mode );
\r
222 template<class Path>
\r
223 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
224 open( const Path & file_ph );
\r
225 void open( const wpath & file_ph );
\r
227 template<class Path>
\r
228 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
229 open( const Path & file_ph, std::ios_base::openmode mode );
\r
230 void open( const wpath & file_ph, std::ios_base::openmode mode );
\r
234 explicit basic_fstream( const path & file_ph );
\r
235 basic_fstream( const path & file_ph, std::ios_base::openmode mode );
\r
236 # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
\r
237 void open( const path & file_ph );
\r
238 void open( const path & file_ph, std::ios_base::openmode mode );
\r
240 virtual ~basic_fstream() {}
\r
244 typedef basic_filebuf<char> filebuf;
\r
245 typedef basic_ifstream<char> ifstream;
\r
246 typedef basic_ofstream<char> ofstream;
\r
247 typedef basic_fstream<char> fstream;
\r
249 # ifndef BOOST_FILESYSTEM_NARROW_ONLY
\r
250 typedef basic_filebuf<wchar_t> wfilebuf;
\r
251 typedef basic_ifstream<wchar_t> wifstream;
\r
252 typedef basic_fstream<wchar_t> wfstream;
\r
253 typedef basic_ofstream<wchar_t> wofstream;
\r
256 # ifndef BOOST_FILESYSTEM_NARROW_ONLY
\r
258 // basic_filebuf definitions -----------------------------------------------//
\r
260 template <class charT, class traits>
\r
261 template<class Path>
\r
262 typename boost::enable_if<is_basic_path<Path>,
\r
263 basic_filebuf<charT,traits> *>::type
\r
264 basic_filebuf<charT,traits>::open( const Path & file_ph,
\r
265 std::ios_base::openmode mode )
\r
267 return (std::basic_filebuf<charT,traits>::open( detail::path_proxy(
\r
268 file_ph.external_file_string(), mode ).c_str(), mode )
\r
272 template <class charT, class traits>
\r
273 basic_filebuf<charT,traits> *
\r
274 basic_filebuf<charT, traits>::open( const wpath & file_ph,
\r
275 std::ios_base::openmode mode )
\r
277 return this->BOOST_NESTED_TEMPLATE open<wpath>( file_ph, mode );
\r
280 // basic_ifstream definitions ----------------------------------------------//
\r
282 template <class charT, class traits> template<class Path>
\r
283 basic_ifstream<charT,traits>::basic_ifstream(const Path & file_ph,
\r
284 typename boost::enable_if<is_basic_path<Path> >::type* )
\r
285 : std::basic_ifstream<charT,traits>(
\r
286 detail::path_proxy( file_ph.external_file_string(),
\r
287 std::ios_base::in ).c_str(), std::ios_base::in ) {}
\r
289 template <class charT, class traits>
\r
290 basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph )
\r
291 : std::basic_ifstream<charT,traits>(
\r
292 detail::path_proxy( file_ph.external_file_string(),
\r
293 std::ios_base::in ).c_str(), std::ios_base::in ) {}
\r
295 template <class charT, class traits> template<class Path>
\r
296 basic_ifstream<charT,traits>::basic_ifstream( const Path & file_ph,
\r
297 std::ios_base::openmode mode,
\r
298 typename boost::enable_if<is_basic_path<Path> >::type* )
\r
299 : std::basic_ifstream<charT,traits>(
\r
300 detail::path_proxy( file_ph.external_file_string(),
\r
301 mode ).c_str(), mode | std::ios_base::in ) {}
\r
303 template <class charT, class traits>
\r
304 basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph,
\r
305 std::ios_base::openmode mode )
\r
306 : std::basic_ifstream<charT,traits>(
\r
307 detail::path_proxy( file_ph.external_file_string(),
\r
308 mode ).c_str(), mode | std::ios_base::in ) {}
\r
310 template <class charT, class traits> template<class Path>
\r
311 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
312 basic_ifstream<charT,traits>::open( const Path & file_ph )
\r
314 std::basic_ifstream<charT,traits>::open(
\r
315 detail::path_proxy( file_ph.external_file_string(),
\r
316 std::ios_base::in ).c_str(), std::ios_base::in );
\r
319 template <class charT, class traits>
\r
320 void basic_ifstream<charT,traits>::open( const wpath & file_ph )
\r
322 std::basic_ifstream<charT,traits>::open(
\r
323 detail::path_proxy( file_ph.external_file_string(),
\r
324 std::ios_base::in ).c_str(), std::ios_base::in );
\r
327 template <class charT, class traits> template<class Path>
\r
328 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
329 basic_ifstream<charT,traits>::open( const Path & file_ph,
\r
330 std::ios_base::openmode mode )
\r
332 std::basic_ifstream<charT,traits>::open(
\r
333 detail::path_proxy( file_ph.external_file_string(),
\r
334 mode ).c_str(), mode | std::ios_base::in );
\r
337 template <class charT, class traits>
\r
338 void basic_ifstream<charT,traits>::open( const wpath & file_ph,
\r
339 std::ios_base::openmode mode )
\r
341 std::basic_ifstream<charT,traits>::open(
\r
342 detail::path_proxy( file_ph.external_file_string(),
\r
343 mode ).c_str(), mode | std::ios_base::in );
\r
346 // basic_ofstream definitions ----------------------------------------------//
\r
348 template <class charT, class traits> template<class Path>
\r
349 basic_ofstream<charT,traits>::basic_ofstream(const Path & file_ph,
\r
350 typename boost::enable_if<is_basic_path<Path> >::type* )
\r
351 : std::basic_ofstream<charT,traits>(
\r
352 detail::path_proxy( file_ph.external_file_string(),
\r
353 std::ios_base::out ).c_str(), std::ios_base::out ) {}
\r
355 template <class charT, class traits>
\r
356 basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph )
\r
357 : std::basic_ofstream<charT,traits>(
\r
358 detail::path_proxy( file_ph.external_file_string(),
\r
359 std::ios_base::out ).c_str(), std::ios_base::out ) {}
\r
361 template <class charT, class traits> template<class Path>
\r
362 basic_ofstream<charT,traits>::basic_ofstream( const Path & file_ph,
\r
363 std::ios_base::openmode mode,
\r
364 typename boost::enable_if<is_basic_path<Path> >::type* )
\r
365 : std::basic_ofstream<charT,traits>(
\r
366 detail::path_proxy( file_ph.external_file_string(),
\r
367 mode ).c_str(), mode | std::ios_base::out ) {}
\r
369 template <class charT, class traits>
\r
370 basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph,
\r
371 std::ios_base::openmode mode )
\r
372 : std::basic_ofstream<charT,traits>(
\r
373 detail::path_proxy( file_ph.external_file_string(),
\r
374 mode ).c_str(), mode | std::ios_base::out ) {}
\r
376 template <class charT, class traits> template<class Path>
\r
377 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
378 basic_ofstream<charT,traits>::open( const Path & file_ph )
\r
380 std::basic_ofstream<charT,traits>::open(
\r
381 detail::path_proxy( file_ph.external_file_string(),
\r
382 std::ios_base::out ).c_str(), std::ios_base::out );
\r
385 template <class charT, class traits>
\r
386 void basic_ofstream<charT,traits>::open( const wpath & file_ph )
\r
388 std::basic_ofstream<charT,traits>::open(
\r
389 detail::path_proxy( file_ph.external_file_string(),
\r
390 std::ios_base::out ).c_str(), std::ios_base::out );
\r
393 template <class charT, class traits> template<class Path>
\r
394 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
395 basic_ofstream<charT,traits>::open( const Path & file_ph,
\r
396 std::ios_base::openmode mode )
\r
398 std::basic_ofstream<charT,traits>::open(
\r
399 detail::path_proxy( file_ph.external_file_string(),
\r
400 mode ).c_str(), mode | std::ios_base::out );
\r
403 template <class charT, class traits>
\r
404 void basic_ofstream<charT,traits>::open( const wpath & file_ph,
\r
405 std::ios_base::openmode mode )
\r
407 std::basic_ofstream<charT,traits>::open(
\r
408 detail::path_proxy( file_ph.external_file_string(),
\r
409 mode ).c_str(), mode | std::ios_base::out );
\r
412 // basic_fstream definitions -----------------------------------------------//
\r
414 template <class charT, class traits> template<class Path>
\r
415 basic_fstream<charT,traits>::basic_fstream(const Path & file_ph,
\r
416 typename boost::enable_if<is_basic_path<Path> >::type* )
\r
417 : std::basic_fstream<charT,traits>(
\r
418 detail::path_proxy( file_ph.external_file_string(),
\r
419 std::ios_base::in|std::ios_base::out ).c_str(),
\r
420 std::ios_base::in|std::ios_base::out ) {}
\r
422 template <class charT, class traits>
\r
423 basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph )
\r
424 : std::basic_fstream<charT,traits>(
\r
425 detail::path_proxy( file_ph.external_file_string(),
\r
426 std::ios_base::in|std::ios_base::out ).c_str(),
\r
427 std::ios_base::in|std::ios_base::out ) {}
\r
429 template <class charT, class traits> template<class Path>
\r
430 basic_fstream<charT,traits>::basic_fstream( const Path & file_ph,
\r
431 std::ios_base::openmode mode,
\r
432 typename boost::enable_if<is_basic_path<Path> >::type* )
\r
433 : std::basic_fstream<charT,traits>(
\r
434 detail::path_proxy( file_ph.external_file_string(),
\r
435 mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
\r
437 template <class charT, class traits>
\r
438 basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph,
\r
439 std::ios_base::openmode mode )
\r
440 : std::basic_fstream<charT,traits>(
\r
441 detail::path_proxy( file_ph.external_file_string(),
\r
442 mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
\r
444 template <class charT, class traits> template<class Path>
\r
445 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
446 basic_fstream<charT,traits>::open( const Path & file_ph )
\r
448 std::basic_fstream<charT,traits>::open(
\r
449 detail::path_proxy( file_ph.external_file_string(),
\r
450 std::ios_base::in|std::ios_base::out ).c_str(),
\r
451 std::ios_base::in|std::ios_base::out );
\r
454 template <class charT, class traits>
\r
455 void basic_fstream<charT,traits>::open( const wpath & file_ph )
\r
457 std::basic_fstream<charT,traits>::open(
\r
458 detail::path_proxy( file_ph.external_file_string(),
\r
459 std::ios_base::in|std::ios_base::out ).c_str(),
\r
460 std::ios_base::in|std::ios_base::out );
\r
463 template <class charT, class traits> template<class Path>
\r
464 typename boost::enable_if<is_basic_path<Path>, void>::type
\r
465 basic_fstream<charT,traits>::open( const Path & file_ph,
\r
466 std::ios_base::openmode mode )
\r
468 std::basic_fstream<charT,traits>::open(
\r
469 detail::path_proxy( file_ph.external_file_string(),
\r
470 mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
\r
473 template <class charT, class traits>
\r
474 void basic_fstream<charT,traits>::open( const wpath & file_ph,
\r
475 std::ios_base::openmode mode )
\r
477 std::basic_fstream<charT,traits>::open(
\r
478 detail::path_proxy( file_ph.external_file_string(),
\r
479 mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
\r
484 # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
\r
485 template <class charT, class traits>
\r
486 basic_filebuf<charT,traits> *
\r
487 basic_filebuf<charT, traits>::open( const path & file_ph,
\r
488 std::ios_base::openmode mode )
\r
490 return std::basic_filebuf<charT,traits>::open(
\r
491 file_ph.file_string().c_str(), mode ) == 0 ? 0 : this;
\r
495 template <class charT, class traits>
\r
496 basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph )
\r
497 : std::basic_ifstream<charT,traits>(
\r
498 file_ph.file_string().c_str(), std::ios_base::in ) {}
\r
500 template <class charT, class traits>
\r
501 basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph,
\r
502 std::ios_base::openmode mode )
\r
503 : std::basic_ifstream<charT,traits>(
\r
504 file_ph.file_string().c_str(), mode ) {}
\r
506 # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
\r
507 template <class charT, class traits>
\r
508 void basic_ifstream<charT,traits>::open( const path & file_ph )
\r
510 std::basic_ifstream<charT,traits>::open(
\r
511 file_ph.file_string().c_str(), std::ios_base::in );
\r
514 template <class charT, class traits>
\r
515 void basic_ifstream<charT,traits>::open( const path & file_ph,
\r
516 std::ios_base::openmode mode )
\r
518 std::basic_ifstream<charT,traits>::open(
\r
519 file_ph.file_string().c_str(), mode );
\r
523 template <class charT, class traits>
\r
524 basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph )
\r
525 : std::basic_ofstream<charT,traits>(
\r
526 file_ph.file_string().c_str(), std::ios_base::out ) {}
\r
528 template <class charT, class traits>
\r
529 basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph,
\r
530 std::ios_base::openmode mode )
\r
531 : std::basic_ofstream<charT,traits>(
\r
532 file_ph.file_string().c_str(), mode ) {}
\r
534 # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
\r
535 template <class charT, class traits>
\r
536 void basic_ofstream<charT,traits>::open( const path & file_ph )
\r
538 std::basic_ofstream<charT,traits>::open(
\r
539 file_ph.file_string().c_str(), std::ios_base::out );
\r
542 template <class charT, class traits>
\r
543 void basic_ofstream<charT,traits>::open( const path & file_ph,
\r
544 std::ios_base::openmode mode )
\r
546 std::basic_ofstream<charT,traits>::open(
\r
547 file_ph.file_string().c_str(), mode );
\r
551 template <class charT, class traits>
\r
552 basic_fstream<charT,traits>::basic_fstream( const path & file_ph )
\r
553 : std::basic_fstream<charT,traits>(
\r
554 file_ph.file_string().c_str(),
\r
555 std::ios_base::in|std::ios_base::out ) {}
\r
558 template <class charT, class traits>
\r
559 basic_fstream<charT,traits>::basic_fstream( const path & file_ph,
\r
560 std::ios_base::openmode mode )
\r
561 : std::basic_fstream<charT,traits>(
\r
562 file_ph.file_string().c_str(), mode ) {}
\r
564 # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
\r
565 template <class charT, class traits>
\r
566 void basic_fstream<charT,traits>::open( const path & file_ph )
\r
568 std::basic_fstream<charT,traits>::open(
\r
569 file_ph.file_string().c_str(), std::ios_base::in|std::ios_base::out );
\r
572 template <class charT, class traits>
\r
573 void basic_fstream<charT,traits>::open( const path & file_ph,
\r
574 std::ios_base::openmode mode )
\r
576 std::basic_fstream<charT,traits>::open(
\r
577 file_ph.file_string().c_str(), mode );
\r
580 } // namespace filesystem
\r
581 } // namespace boost
\r
583 #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
\r
584 #endif // BOOST_FILESYSTEM_FSTREAM_HPP
\r