imgtools/imglib/boostlibrary/boost/filesystem/fstream.hpp
author lorewang
Mon, 22 Nov 2010 10:56:31 +0800
changeset 700 c22eff170fac
parent 600 6d08f4a05d93
permissions -rw-r--r--
update from trunk
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
600
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     1
//  boost/filesystem/fstream.hpp  --------------------------------------------//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     2
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     3
//  Copyright Beman Dawes 2002.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     4
//  Use, modification, and distribution is subject to the Boost Software
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     5
//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     6
//  http://www.boost.org/LICENSE_1_0.txt)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     7
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     8
//  See library home page at http://www.boost.org/libs/filesystem
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     9
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    10
//----------------------------------------------------------------------------// 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    11
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    12
#ifndef BOOST_FILESYSTEM_FSTREAM_HPP
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    13
#define BOOST_FILESYSTEM_FSTREAM_HPP
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    14
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    15
#include <boost/filesystem/operations.hpp> // for 8.3 hack (see below)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    16
#include <boost/utility/enable_if.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    17
#include <boost/detail/workaround.hpp>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    18
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    19
#include <iosfwd>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    20
#include <fstream>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    21
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    22
#include <boost/config/abi_prefix.hpp> // must be the last #include
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    23
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    24
// NOTE: fstream.hpp for Boost 1.32.0 and earlier supplied workarounds for
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    25
// various compiler problems. They have been removed to ease development of the
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    26
// basic i18n functionality. Once the new interface is stable, the workarounds
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    27
// will be reinstated for any compilers that otherwise can support the rest of
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    28
// the library after internationalization.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    29
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    30
namespace boost
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    31
{
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    32
  namespace filesystem
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    33
  {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    34
    namespace detail
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    35
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    36
#   if defined(BOOST_WINDOWS_API) && !defined(BOOST_FILESYSTEM_NARROW_ONLY)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    37
#     if !defined(BOOST_DINKUMWARE_STDLIB) || BOOST_DINKUMWARE_STDLIB < 405
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    38
      // The 8.3 hack:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    39
      // C++98 does not supply a wchar_t open, so try to get an equivalent
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    40
      // narrow char name based on the short, so-called 8.3, name.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    41
      // Not needed for Dinkumware 405 and later as they do supply wchar_t open.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    42
      BOOST_FILESYSTEM_DECL bool create_file_api( const std::wstring & ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    43
        std::ios_base::openmode mode ); // true if succeeds
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    44
      BOOST_FILESYSTEM_DECL std::string narrow_path_api(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    45
        const std::wstring & ph ); // return is empty if fails
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    46
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    47
      inline std::string path_proxy( const std::wstring & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    48
        std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    49
      // Return a non-existant path if cannot supply narrow short path.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    50
      // An empty path doesn't work because some Dinkumware versions
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    51
      // assert the path is non-empty.  
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    52
      {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    53
        std::string narrow_ph;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    54
        bool created_file( false );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    55
        if ( !exists( file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    56
          && (mode & std::ios_base::out) != 0
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    57
          && create_file_api( file_ph, mode ) )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    58
        {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    59
          created_file = true;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    60
        }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    61
        narrow_ph = narrow_path_api( file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    62
        if ( narrow_ph.empty() )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    63
        {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    64
          if ( created_file ) remove_api( file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    65
          narrow_ph = "\x01";
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    66
        }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    67
        return narrow_ph;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    68
      }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    69
#     else
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    70
      // Dinkumware 405 and later does supply wchar_t functions
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    71
      inline const std::wstring & path_proxy( const std::wstring & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    72
        std::ios_base::openmode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    73
        { return file_ph; }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    74
#     endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    75
#   endif 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    76
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    77
      inline const std::string & path_proxy( const std::string & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    78
        std::ios_base::openmode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    79
        { return file_ph; }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    80
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    81
    } // namespace detail
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    82
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    83
    template < class charT, class traits = std::char_traits<charT> >
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    84
    class basic_filebuf : public std::basic_filebuf<charT,traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    85
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    86
    private: // disallow copying
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    87
      basic_filebuf( const basic_filebuf & );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    88
      const basic_filebuf & operator=( const basic_filebuf & ); 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    89
    public:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    90
      basic_filebuf() {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    91
      virtual ~basic_filebuf() {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    92
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    93
#   ifndef BOOST_FILESYSTEM_NARROW_ONLY
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    94
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    95
      typename boost::enable_if<is_basic_path<Path>,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    96
        basic_filebuf<charT,traits> *>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    97
      open( const Path & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    98
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    99
      basic_filebuf<charT,traits> *
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   100
      open( const wpath & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   101
#   endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   102
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   103
#   if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   104
      basic_filebuf<charT,traits> *
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   105
      open( const path & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   106
#   endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   107
    };
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   108
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   109
    template < class charT, class traits = std::char_traits<charT> >
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   110
    class basic_ifstream : public std::basic_ifstream<charT,traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   111
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   112
    private: // disallow copying
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   113
      basic_ifstream( const basic_ifstream & );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   114
      const basic_ifstream & operator=( const basic_ifstream & ); 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   115
    public:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   116
      basic_ifstream() {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   117
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   118
      // use two signatures, rather than one signature with default second
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   119
      // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   120
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   121
#   ifndef BOOST_FILESYSTEM_NARROW_ONLY
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   122
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   123
      explicit basic_ifstream( const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   124
        typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   125
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   126
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   127
      basic_ifstream( const Path & file_ph, std::ios_base::openmode mode,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   128
        typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   129
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   130
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   131
      typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   132
      open( const Path & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   133
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   134
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   135
      typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   136
      open( const Path & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   137
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   138
      explicit basic_ifstream( const wpath & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   139
      basic_ifstream( const wpath & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   140
      void open( const wpath & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   141
      void open( const wpath & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   142
#   endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   143
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   144
      explicit basic_ifstream( const path & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   145
      basic_ifstream( const path & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   146
#   if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   147
      void open( const path & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   148
      void open( const path & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   149
#   endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   150
      virtual ~basic_ifstream() {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   151
    };
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   152
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   153
    template < class charT, class traits = std::char_traits<charT> >
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   154
    class basic_ofstream : public std::basic_ofstream<charT,traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   155
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   156
    private: // disallow copying
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   157
      basic_ofstream( const basic_ofstream & );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   158
      const basic_ofstream & operator=( const basic_ofstream & ); 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   159
    public:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   160
      basic_ofstream() {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   161
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   162
      // use two signatures, rather than one signature with default second
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   163
      // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   164
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   165
#   ifndef BOOST_FILESYSTEM_NARROW_ONLY
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   166
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   167
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   168
      explicit basic_ofstream( const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   169
        typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   170
      explicit basic_ofstream( const wpath & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   171
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   172
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   173
      basic_ofstream( const Path & file_ph, std::ios_base::openmode mode,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   174
        typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   175
      basic_ofstream( const wpath & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   176
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   177
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   178
      typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   179
      open( const Path & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   180
      void open( const wpath & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   181
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   182
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   183
      typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   184
      open( const Path & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   185
      void open( const wpath & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   186
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   187
#   endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   188
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   189
      explicit basic_ofstream( const path & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   190
      basic_ofstream( const path & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   191
#   if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   192
      void open( const path & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   193
      void open( const path & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   194
#   endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   195
      virtual ~basic_ofstream() {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   196
    };
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   197
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   198
    template < class charT, class traits = std::char_traits<charT> >
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   199
    class basic_fstream : public std::basic_fstream<charT,traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   200
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   201
    private: // disallow copying
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   202
      basic_fstream( const basic_fstream & );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   203
      const basic_fstream & operator=( const basic_fstream & ); 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   204
    public:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   205
      basic_fstream() {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   206
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   207
      // use two signatures, rather than one signature with default second
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   208
      // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   209
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   210
#   ifndef BOOST_FILESYSTEM_NARROW_ONLY
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   211
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   212
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   213
      explicit basic_fstream( const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   214
        typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   215
      explicit basic_fstream( const wpath & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   216
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   217
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   218
      basic_fstream( const Path & file_ph, std::ios_base::openmode mode,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   219
        typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   220
      basic_fstream( const wpath & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   221
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   222
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   223
      typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   224
      open( const Path & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   225
      void open( const wpath & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   226
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   227
      template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   228
      typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   229
      open( const Path & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   230
      void open( const wpath & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   231
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   232
#   endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   233
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   234
      explicit basic_fstream( const path & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   235
      basic_fstream( const path & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   236
#   if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   237
      void open( const path & file_ph );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   238
      void open( const path & file_ph, std::ios_base::openmode mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   239
#   endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   240
      virtual ~basic_fstream() {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   241
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   242
    };
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   243
 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   244
    typedef basic_filebuf<char> filebuf;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   245
    typedef basic_ifstream<char> ifstream;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   246
    typedef basic_ofstream<char> ofstream;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   247
    typedef basic_fstream<char> fstream;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   248
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   249
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   250
    typedef basic_filebuf<wchar_t> wfilebuf;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   251
    typedef basic_ifstream<wchar_t> wifstream;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   252
    typedef basic_fstream<wchar_t> wfstream;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   253
    typedef basic_ofstream<wchar_t> wofstream;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   254
# endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   255
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   256
# ifndef BOOST_FILESYSTEM_NARROW_ONLY
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   257
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   258
//  basic_filebuf definitions  -----------------------------------------------//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   259
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   260
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   261
    template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   262
    typename boost::enable_if<is_basic_path<Path>,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   263
      basic_filebuf<charT,traits> *>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   264
    basic_filebuf<charT,traits>::open( const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   265
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   266
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   267
      return (std::basic_filebuf<charT,traits>::open( detail::path_proxy(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   268
        file_ph.external_file_string(), mode ).c_str(), mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   269
          == 0) ? 0 : this;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   270
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   271
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   272
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   273
    basic_filebuf<charT,traits> *
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   274
    basic_filebuf<charT, traits>::open( const wpath & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   275
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   276
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   277
      return this->BOOST_NESTED_TEMPLATE open<wpath>( file_ph, mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   278
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   279
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   280
//  basic_ifstream definitions  ----------------------------------------------//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   281
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   282
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   283
    basic_ifstream<charT,traits>::basic_ifstream(const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   284
      typename boost::enable_if<is_basic_path<Path> >::type* )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   285
      : std::basic_ifstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   286
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   287
          std::ios_base::in ).c_str(), std::ios_base::in ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   288
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   289
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   290
    basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   291
      : std::basic_ifstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   292
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   293
          std::ios_base::in ).c_str(), std::ios_base::in ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   294
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   295
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   296
    basic_ifstream<charT,traits>::basic_ifstream( const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   297
      std::ios_base::openmode mode,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   298
      typename boost::enable_if<is_basic_path<Path> >::type* )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   299
      : std::basic_ifstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   300
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   301
          mode ).c_str(), mode | std::ios_base::in ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   302
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   303
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   304
    basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   305
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   306
      : std::basic_ifstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   307
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   308
          mode ).c_str(), mode | std::ios_base::in ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   309
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   310
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   311
    typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   312
    basic_ifstream<charT,traits>::open( const Path & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   313
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   314
      std::basic_ifstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   315
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   316
          std::ios_base::in ).c_str(), std::ios_base::in );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   317
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   318
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   319
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   320
    void basic_ifstream<charT,traits>::open( const wpath & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   321
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   322
      std::basic_ifstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   323
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   324
          std::ios_base::in ).c_str(), std::ios_base::in );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   325
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   326
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   327
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   328
    typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   329
    basic_ifstream<charT,traits>::open( const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   330
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   331
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   332
      std::basic_ifstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   333
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   334
          mode ).c_str(), mode | std::ios_base::in );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   335
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   336
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   337
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   338
    void basic_ifstream<charT,traits>::open( const wpath & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   339
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   340
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   341
      std::basic_ifstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   342
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   343
          mode ).c_str(), mode | std::ios_base::in );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   344
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   345
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   346
//  basic_ofstream definitions  ----------------------------------------------//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   347
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   348
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   349
    basic_ofstream<charT,traits>::basic_ofstream(const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   350
      typename boost::enable_if<is_basic_path<Path> >::type* )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   351
      : std::basic_ofstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   352
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   353
          std::ios_base::out ).c_str(), std::ios_base::out ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   354
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   355
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   356
    basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   357
      : std::basic_ofstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   358
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   359
          std::ios_base::out ).c_str(), std::ios_base::out ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   360
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   361
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   362
    basic_ofstream<charT,traits>::basic_ofstream( const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   363
      std::ios_base::openmode mode,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   364
      typename boost::enable_if<is_basic_path<Path> >::type* )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   365
      : std::basic_ofstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   366
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   367
          mode ).c_str(), mode | std::ios_base::out ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   368
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   369
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   370
    basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   371
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   372
      : std::basic_ofstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   373
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   374
          mode ).c_str(), mode | std::ios_base::out ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   375
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   376
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   377
    typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   378
    basic_ofstream<charT,traits>::open( const Path & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   379
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   380
      std::basic_ofstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   381
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   382
          std::ios_base::out ).c_str(), std::ios_base::out );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   383
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   384
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   385
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   386
    void basic_ofstream<charT,traits>::open( const wpath & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   387
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   388
      std::basic_ofstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   389
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   390
          std::ios_base::out ).c_str(), std::ios_base::out );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   391
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   392
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   393
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   394
    typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   395
    basic_ofstream<charT,traits>::open( const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   396
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   397
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   398
      std::basic_ofstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   399
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   400
          mode ).c_str(), mode | std::ios_base::out );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   401
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   402
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   403
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   404
    void basic_ofstream<charT,traits>::open( const wpath & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   405
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   406
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   407
      std::basic_ofstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   408
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   409
          mode ).c_str(), mode | std::ios_base::out );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   410
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   411
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   412
//  basic_fstream definitions  -----------------------------------------------//
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   413
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   414
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   415
    basic_fstream<charT,traits>::basic_fstream(const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   416
      typename boost::enable_if<is_basic_path<Path> >::type* )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   417
      : std::basic_fstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   418
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   419
          std::ios_base::in|std::ios_base::out ).c_str(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   420
          std::ios_base::in|std::ios_base::out ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   421
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   422
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   423
    basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   424
      : std::basic_fstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   425
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   426
          std::ios_base::in|std::ios_base::out ).c_str(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   427
          std::ios_base::in|std::ios_base::out ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   428
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   429
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   430
    basic_fstream<charT,traits>::basic_fstream( const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   431
      std::ios_base::openmode mode,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   432
      typename boost::enable_if<is_basic_path<Path> >::type* )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   433
      : std::basic_fstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   434
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   435
          mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   436
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   437
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   438
    basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   439
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   440
      : std::basic_fstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   441
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   442
          mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   443
      
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   444
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   445
    typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   446
    basic_fstream<charT,traits>::open( const Path & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   447
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   448
      std::basic_fstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   449
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   450
          std::ios_base::in|std::ios_base::out ).c_str(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   451
          std::ios_base::in|std::ios_base::out );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   452
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   453
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   454
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   455
    void basic_fstream<charT,traits>::open( const wpath & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   456
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   457
      std::basic_fstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   458
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   459
          std::ios_base::in|std::ios_base::out ).c_str(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   460
          std::ios_base::in|std::ios_base::out );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   461
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   462
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   463
    template <class charT, class traits> template<class Path>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   464
    typename boost::enable_if<is_basic_path<Path>, void>::type
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   465
    basic_fstream<charT,traits>::open( const Path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   466
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   467
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   468
      std::basic_fstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   469
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   470
          mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   471
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   472
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   473
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   474
    void basic_fstream<charT,traits>::open( const wpath & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   475
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   476
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   477
      std::basic_fstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   478
        detail::path_proxy( file_ph.external_file_string(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   479
          mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   480
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   481
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   482
# endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   483
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   484
#  if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   485
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   486
    basic_filebuf<charT,traits> *
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   487
    basic_filebuf<charT, traits>::open( const path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   488
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   489
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   490
      return std::basic_filebuf<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   491
        file_ph.file_string().c_str(), mode ) == 0 ? 0 : this;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   492
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   493
#  endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   494
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   495
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   496
    basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   497
      : std::basic_ifstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   498
          file_ph.file_string().c_str(), std::ios_base::in ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   499
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   500
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   501
    basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   502
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   503
      : std::basic_ifstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   504
          file_ph.file_string().c_str(), mode ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   505
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   506
#   if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   507
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   508
    void basic_ifstream<charT,traits>::open( const path & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   509
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   510
      std::basic_ifstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   511
        file_ph.file_string().c_str(), std::ios_base::in );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   512
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   513
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   514
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   515
    void basic_ifstream<charT,traits>::open( const path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   516
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   517
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   518
      std::basic_ifstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   519
        file_ph.file_string().c_str(), mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   520
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   521
#   endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   522
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   523
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   524
    basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   525
      : std::basic_ofstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   526
          file_ph.file_string().c_str(), std::ios_base::out ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   527
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   528
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   529
    basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   530
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   531
      : std::basic_ofstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   532
          file_ph.file_string().c_str(), mode ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   533
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   534
#   if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   535
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   536
    void basic_ofstream<charT,traits>::open( const path & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   537
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   538
      std::basic_ofstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   539
        file_ph.file_string().c_str(), std::ios_base::out );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   540
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   541
    
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   542
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   543
    void basic_ofstream<charT,traits>::open( const path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   544
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   545
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   546
      std::basic_ofstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   547
        file_ph.file_string().c_str(), mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   548
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   549
#   endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   550
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   551
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   552
    basic_fstream<charT,traits>::basic_fstream( const path & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   553
      : std::basic_fstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   554
          file_ph.file_string().c_str(),
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   555
          std::ios_base::in|std::ios_base::out ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   556
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   557
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   558
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   559
    basic_fstream<charT,traits>::basic_fstream( const path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   560
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   561
      : std::basic_fstream<charT,traits>(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   562
          file_ph.file_string().c_str(), mode ) {}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   563
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   564
#   if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   565
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   566
    void basic_fstream<charT,traits>::open( const path & file_ph )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   567
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   568
      std::basic_fstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   569
        file_ph.file_string().c_str(), std::ios_base::in|std::ios_base::out );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   570
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   571
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   572
    template <class charT, class traits>
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   573
    void basic_fstream<charT,traits>::open( const path & file_ph,
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   574
      std::ios_base::openmode mode )
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   575
    {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   576
      std::basic_fstream<charT,traits>::open(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   577
        file_ph.file_string().c_str(), mode );
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   578
    }
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   579
#   endif
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   580
  } // namespace filesystem
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   581
} // namespace boost
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   582
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   583
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
   584
#endif  // BOOST_FILESYSTEM_FSTREAM_HPP