]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/filesystem/fstream.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
642f7336ee5093d85d5361f45b0e5cf8b5dd5b53
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / filesystem / fstream.hpp
1 //  boost/filesystem/fstream.hpp  --------------------------------------------//\r
2 \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
7 \r
8 //  See library home page at http://www.boost.org/libs/filesystem\r
9 \r
10 //----------------------------------------------------------------------------// \r
11 \r
12 #ifndef BOOST_FILESYSTEM_FSTREAM_HPP\r
13 #define BOOST_FILESYSTEM_FSTREAM_HPP\r
14 \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
18 \r
19 #include <iosfwd>\r
20 #include <fstream>\r
21 \r
22 #include <boost/config/abi_prefix.hpp> // must be the last #include\r
23 \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
29 \r
30 namespace boost\r
31 {\r
32   namespace filesystem\r
33   {\r
34     namespace detail\r
35     {\r
36 #   if defined(BOOST_WINDOWS_API) && !defined(BOOST_FILESYSTEM_NARROW_ONLY)\r
37 #     if !defined(BOOST_DINKUMWARE_STDLIB) || BOOST_DINKUMWARE_STDLIB < 405\r
38       // The 8.3 hack:\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
46 \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
52       {\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
58         {\r
59           created_file = true;\r
60         }\r
61         narrow_ph = narrow_path_api( file_ph );\r
62         if ( narrow_ph.empty() )\r
63         {\r
64           if ( created_file ) remove_api( file_ph );\r
65           narrow_ph = "\x01";\r
66         }\r
67         return narrow_ph;\r
68       }\r
69 #     else\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
73         { return file_ph; }\r
74 #     endif\r
75 #   endif \r
76 \r
77       inline const std::string & path_proxy( const std::string & file_ph,\r
78         std::ios_base::openmode )\r
79         { return file_ph; }\r
80 \r
81     } // namespace detail\r
82 \r
83     template < class charT, class traits = std::char_traits<charT> >\r
84     class basic_filebuf : public std::basic_filebuf<charT,traits>\r
85     {\r
86     private: // disallow copying\r
87       basic_filebuf( const basic_filebuf & );\r
88       const basic_filebuf & operator=( const basic_filebuf & ); \r
89     public:\r
90       basic_filebuf() {}\r
91       virtual ~basic_filebuf() {}\r
92 \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
98 \r
99       basic_filebuf<charT,traits> *\r
100       open( const wpath & file_ph, std::ios_base::openmode mode );\r
101 #   endif\r
102 \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
106 #   endif\r
107     };\r
108 \r
109     template < class charT, class traits = std::char_traits<charT> >\r
110     class basic_ifstream : public std::basic_ifstream<charT,traits>\r
111     {\r
112     private: // disallow copying\r
113       basic_ifstream( const basic_ifstream & );\r
114       const basic_ifstream & operator=( const basic_ifstream & ); \r
115     public:\r
116       basic_ifstream() {}\r
117 \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
120 \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
125 \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
129 \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
133 \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
137 \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
142 #   endif\r
143 \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
149 #   endif\r
150       virtual ~basic_ifstream() {}\r
151     };\r
152 \r
153     template < class charT, class traits = std::char_traits<charT> >\r
154     class basic_ofstream : public std::basic_ofstream<charT,traits>\r
155     {\r
156     private: // disallow copying\r
157       basic_ofstream( const basic_ofstream & );\r
158       const basic_ofstream & operator=( const basic_ofstream & ); \r
159     public:\r
160       basic_ofstream() {}\r
161 \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
164 \r
165 #   ifndef BOOST_FILESYSTEM_NARROW_ONLY\r
166 \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
171 \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
176 \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
181 \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
186 \r
187 #   endif\r
188 \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
194 #   endif\r
195       virtual ~basic_ofstream() {}\r
196     };\r
197 \r
198     template < class charT, class traits = std::char_traits<charT> >\r
199     class basic_fstream : public std::basic_fstream<charT,traits>\r
200     {\r
201     private: // disallow copying\r
202       basic_fstream( const basic_fstream & );\r
203       const basic_fstream & operator=( const basic_fstream & ); \r
204     public:\r
205       basic_fstream() {}\r
206 \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
209 \r
210 #   ifndef BOOST_FILESYSTEM_NARROW_ONLY\r
211 \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
216 \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
221 \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
226 \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
231 \r
232 #   endif\r
233 \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
239 #   endif\r
240       virtual ~basic_fstream() {}\r
241 \r
242     };\r
243  \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
248 \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
254 # endif\r
255     \r
256 # ifndef BOOST_FILESYSTEM_NARROW_ONLY\r
257 \r
258 //  basic_filebuf definitions  -----------------------------------------------//\r
259 \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
266     {\r
267       return (std::basic_filebuf<charT,traits>::open( detail::path_proxy(\r
268         file_ph.external_file_string(), mode ).c_str(), mode )\r
269           == 0) ? 0 : this;\r
270     }\r
271 \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
276     {\r
277       return this->BOOST_NESTED_TEMPLATE open<wpath>( file_ph, mode );\r
278     }\r
279 \r
280 //  basic_ifstream definitions  ----------------------------------------------//\r
281 \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
288 \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
294     \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
302 \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
309 \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
313     {\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
317     }\r
318 \r
319     template <class charT, class traits>\r
320     void basic_ifstream<charT,traits>::open( const wpath & file_ph )\r
321     {\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
325     }\r
326     \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
331     {\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
335     }\r
336     \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
340     {\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
344     }\r
345 \r
346 //  basic_ofstream definitions  ----------------------------------------------//\r
347 \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
354 \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
360 \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
368 \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
375     \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
379     {\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
383     }\r
384     \r
385     template <class charT, class traits>\r
386     void basic_ofstream<charT,traits>::open( const wpath & file_ph )\r
387     {\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
391     }\r
392     \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
397     {\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
401     }\r
402 \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
406     {\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
410     }\r
411 \r
412 //  basic_fstream definitions  -----------------------------------------------//\r
413 \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
421 \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
428 \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
436     \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
443       \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
447     {\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
452     }\r
453 \r
454     template <class charT, class traits>\r
455     void basic_fstream<charT,traits>::open( const wpath & file_ph )\r
456     {\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
461     }\r
462     \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
467     {\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
471     }\r
472 \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
476     {\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
480     }\r
481 \r
482 # endif\r
483 \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
489     {\r
490       return std::basic_filebuf<charT,traits>::open(\r
491         file_ph.file_string().c_str(), mode ) == 0 ? 0 : this;\r
492     }\r
493 #  endif\r
494 \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
499 \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
505     \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
509     {\r
510       std::basic_ifstream<charT,traits>::open(\r
511         file_ph.file_string().c_str(), std::ios_base::in );\r
512     }\r
513     \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
517     {\r
518       std::basic_ifstream<charT,traits>::open(\r
519         file_ph.file_string().c_str(), mode );\r
520     }\r
521 #   endif\r
522 \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
527 \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
533     \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
537     {\r
538       std::basic_ofstream<charT,traits>::open(\r
539         file_ph.file_string().c_str(), std::ios_base::out );\r
540     }\r
541     \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
545     {\r
546       std::basic_ofstream<charT,traits>::open(\r
547         file_ph.file_string().c_str(), mode );\r
548     }\r
549 #   endif\r
550 \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
556 \r
557 \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
563 \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
567     {\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
570     }\r
571 \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
575     {\r
576       std::basic_fstream<charT,traits>::open(\r
577         file_ph.file_string().c_str(), mode );\r
578     }\r
579 #   endif\r
580   } // namespace filesystem\r
581 } // namespace boost\r
582 \r
583 #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas\r
584 #endif  // BOOST_FILESYSTEM_FSTREAM_HPP\r