x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
fstream.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\filesystem\fstream.hpp
旋转
特效
属性
历史版本
// boost/filesystem/fstream.hpp --------------------------------------------// // Copyright Beman Dawes 2002. // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See library home page at http://www.boost.org/libs/filesystem //----------------------------------------------------------------------------// #ifndef BOOST_FILESYSTEM_FSTREAM_HPP #define BOOST_FILESYSTEM_FSTREAM_HPP #include
// for 8.3 hack (see below) #include
#include
#include
#include
#include
// must be the last #include // NOTE: fstream.hpp for Boost 1.32.0 and earlier supplied workarounds for // various compiler problems. They have been removed to ease development of the // basic i18n functionality. Once the new interface is stable, the workarounds // will be reinstated for any compilers that otherwise can support the rest of // the library after internationalization. namespace boost { namespace filesystem { namespace detail { # if defined(BOOST_WINDOWS_API) && !defined(BOOST_FILESYSTEM_NARROW_ONLY) # if !defined(BOOST_DINKUMWARE_STDLIB) || BOOST_DINKUMWARE_STDLIB < 405 // The 8.3 hack: // C++98 does not supply a wchar_t open, so try to get an equivalent // narrow char name based on the short, so-called 8.3, name. // Not needed for Dinkumware 405 and later as they do supply wchar_t open. BOOST_FILESYSTEM_DECL bool create_file_api( const std::wstring & ph, std::ios_base::openmode mode ); // true if succeeds BOOST_FILESYSTEM_DECL std::string narrow_path_api( const std::wstring & ph ); // return is empty if fails inline std::string path_proxy( const std::wstring & file_ph, std::ios_base::openmode mode ) // Return a non-existant path if cannot supply narrow short path. // An empty path doesn't work because some Dinkumware versions // assert the path is non-empty. { std::string narrow_ph; bool created_file( false ); if ( !exists( file_ph ) && (mode & std::ios_base::out) != 0 && create_file_api( file_ph, mode ) ) { created_file = true; } narrow_ph = narrow_path_api( file_ph ); if ( narrow_ph.empty() ) { if ( created_file ) remove_api( file_ph ); narrow_ph = "\x01"; } return narrow_ph; } # else // Dinkumware 405 and later does supply wchar_t functions inline const std::wstring & path_proxy( const std::wstring & file_ph, std::ios_base::openmode ) { return file_ph; } # endif # endif inline const std::string & path_proxy( const std::string & file_ph, std::ios_base::openmode ) { return file_ph; } } // namespace detail template < class charT, class traits = std::char_traits
> class basic_filebuf : public std::basic_filebuf
{ private: // disallow copying basic_filebuf( const basic_filebuf & ); const basic_filebuf & operator=( const basic_filebuf & ); public: basic_filebuf() {} virtual ~basic_filebuf() {} # ifndef BOOST_FILESYSTEM_NARROW_ONLY template
typename boost::enable_if
, basic_filebuf
*>::type open( const Path & file_ph, std::ios_base::openmode mode ); basic_filebuf
* open( const wpath & file_ph, std::ios_base::openmode mode ); # endif # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this basic_filebuf
* open( const path & file_ph, std::ios_base::openmode mode ); # endif }; template < class charT, class traits = std::char_traits
> class basic_ifstream : public std::basic_ifstream
{ private: // disallow copying basic_ifstream( const basic_ifstream & ); const basic_ifstream & operator=( const basic_ifstream & ); public: basic_ifstream() {} // use two signatures, rather than one signature with default second // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416) # ifndef BOOST_FILESYSTEM_NARROW_ONLY template
explicit basic_ifstream( const Path & file_ph, typename boost::enable_if
>::type* dummy = 0 ); template
basic_ifstream( const Path & file_ph, std::ios_base::openmode mode, typename boost::enable_if
>::type* dummy = 0 ); template
typename boost::enable_if
, void>::type open( const Path & file_ph ); template
typename boost::enable_if
, void>::type open( const Path & file_ph, std::ios_base::openmode mode ); explicit basic_ifstream( const wpath & file_ph ); basic_ifstream( const wpath & file_ph, std::ios_base::openmode mode ); void open( const wpath & file_ph ); void open( const wpath & file_ph, std::ios_base::openmode mode ); # endif explicit basic_ifstream( const path & file_ph ); basic_ifstream( const path & file_ph, std::ios_base::openmode mode ); # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this void open( const path & file_ph ); void open( const path & file_ph, std::ios_base::openmode mode ); # endif virtual ~basic_ifstream() {} }; template < class charT, class traits = std::char_traits
> class basic_ofstream : public std::basic_ofstream
{ private: // disallow copying basic_ofstream( const basic_ofstream & ); const basic_ofstream & operator=( const basic_ofstream & ); public: basic_ofstream() {} // use two signatures, rather than one signature with default second // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416) # ifndef BOOST_FILESYSTEM_NARROW_ONLY template
explicit basic_ofstream( const Path & file_ph, typename boost::enable_if
>::type* dummy = 0 ); explicit basic_ofstream( const wpath & file_ph ); template
basic_ofstream( const Path & file_ph, std::ios_base::openmode mode, typename boost::enable_if
>::type* dummy = 0 ); basic_ofstream( const wpath & file_ph, std::ios_base::openmode mode ); template
typename boost::enable_if
, void>::type open( const Path & file_ph ); void open( const wpath & file_ph ); template
typename boost::enable_if
, void>::type open( const Path & file_ph, std::ios_base::openmode mode ); void open( const wpath & file_ph, std::ios_base::openmode mode ); # endif explicit basic_ofstream( const path & file_ph ); basic_ofstream( const path & file_ph, std::ios_base::openmode mode ); # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this void open( const path & file_ph ); void open( const path & file_ph, std::ios_base::openmode mode ); # endif virtual ~basic_ofstream() {} }; template < class charT, class traits = std::char_traits
> class basic_fstream : public std::basic_fstream
{ private: // disallow copying basic_fstream( const basic_fstream & ); const basic_fstream & operator=( const basic_fstream & ); public: basic_fstream() {} // use two signatures, rather than one signature with default second // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416) # ifndef BOOST_FILESYSTEM_NARROW_ONLY template
explicit basic_fstream( const Path & file_ph, typename boost::enable_if
>::type* dummy = 0 ); explicit basic_fstream( const wpath & file_ph ); template
basic_fstream( const Path & file_ph, std::ios_base::openmode mode, typename boost::enable_if
>::type* dummy = 0 ); basic_fstream( const wpath & file_ph, std::ios_base::openmode mode ); template
typename boost::enable_if
, void>::type open( const Path & file_ph ); void open( const wpath & file_ph ); template
typename boost::enable_if
, void>::type open( const Path & file_ph, std::ios_base::openmode mode ); void open( const wpath & file_ph, std::ios_base::openmode mode ); # endif explicit basic_fstream( const path & file_ph ); basic_fstream( const path & file_ph, std::ios_base::openmode mode ); # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this void open( const path & file_ph ); void open( const path & file_ph, std::ios_base::openmode mode ); # endif virtual ~basic_fstream() {} }; typedef basic_filebuf
filebuf; typedef basic_ifstream
ifstream; typedef basic_ofstream
ofstream; typedef basic_fstream
fstream; # ifndef BOOST_FILESYSTEM_NARROW_ONLY typedef basic_filebuf
wfilebuf; typedef basic_ifstream
wifstream; typedef basic_fstream
wfstream; typedef basic_ofstream
wofstream; # endif # ifndef BOOST_FILESYSTEM_NARROW_ONLY // basic_filebuf definitions -----------------------------------------------// template
template
typename boost::enable_if
, basic_filebuf
*>::type basic_filebuf
::open( const Path & file_ph, std::ios_base::openmode mode ) { return (std::basic_filebuf
::open( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode ) == 0) ? 0 : this; } template
basic_filebuf
* basic_filebuf
::open( const wpath & file_ph, std::ios_base::openmode mode ) { return this->BOOST_NESTED_TEMPLATE open
( file_ph, mode ); } // basic_ifstream definitions ----------------------------------------------// template
template
basic_ifstream
::basic_ifstream(const Path & file_ph, typename boost::enable_if
>::type* ) : std::basic_ifstream
( detail::path_proxy( file_ph.external_file_string(), std::ios_base::in ).c_str(), std::ios_base::in ) {} template
basic_ifstream
::basic_ifstream( const wpath & file_ph ) : std::basic_ifstream
( detail::path_proxy( file_ph.external_file_string(), std::ios_base::in ).c_str(), std::ios_base::in ) {} template
template
basic_ifstream
::basic_ifstream( const Path & file_ph, std::ios_base::openmode mode, typename boost::enable_if
>::type* ) : std::basic_ifstream
( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::in ) {} template
basic_ifstream
::basic_ifstream( const wpath & file_ph, std::ios_base::openmode mode ) : std::basic_ifstream
( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::in ) {} template
template
typename boost::enable_if
, void>::type basic_ifstream
::open( const Path & file_ph ) { std::basic_ifstream
::open( detail::path_proxy( file_ph.external_file_string(), std::ios_base::in ).c_str(), std::ios_base::in ); } template
void basic_ifstream
::open( const wpath & file_ph ) { std::basic_ifstream
::open( detail::path_proxy( file_ph.external_file_string(), std::ios_base::in ).c_str(), std::ios_base::in ); } template
template
typename boost::enable_if
, void>::type basic_ifstream
::open( const Path & file_ph, std::ios_base::openmode mode ) { std::basic_ifstream
::open( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::in ); } template
void basic_ifstream
::open( const wpath & file_ph, std::ios_base::openmode mode ) { std::basic_ifstream
::open( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::in ); } // basic_ofstream definitions ----------------------------------------------// template
template
basic_ofstream
::basic_ofstream(const Path & file_ph, typename boost::enable_if
>::type* ) : std::basic_ofstream
( detail::path_proxy( file_ph.external_file_string(), std::ios_base::out ).c_str(), std::ios_base::out ) {} template
basic_ofstream
::basic_ofstream( const wpath & file_ph ) : std::basic_ofstream
( detail::path_proxy( file_ph.external_file_string(), std::ios_base::out ).c_str(), std::ios_base::out ) {} template
template
basic_ofstream
::basic_ofstream( const Path & file_ph, std::ios_base::openmode mode, typename boost::enable_if
>::type* ) : std::basic_ofstream
( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::out ) {} template
basic_ofstream
::basic_ofstream( const wpath & file_ph, std::ios_base::openmode mode ) : std::basic_ofstream
( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::out ) {} template
template
typename boost::enable_if
, void>::type basic_ofstream
::open( const Path & file_ph ) { std::basic_ofstream
::open( detail::path_proxy( file_ph.external_file_string(), std::ios_base::out ).c_str(), std::ios_base::out ); } template
void basic_ofstream
::open( const wpath & file_ph ) { std::basic_ofstream
::open( detail::path_proxy( file_ph.external_file_string(), std::ios_base::out ).c_str(), std::ios_base::out ); } template
template
typename boost::enable_if
, void>::type basic_ofstream
::open( const Path & file_ph, std::ios_base::openmode mode ) { std::basic_ofstream
::open( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::out ); } template
void basic_ofstream
::open( const wpath & file_ph, std::ios_base::openmode mode ) { std::basic_ofstream
::open( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::out ); } // basic_fstream definitions -----------------------------------------------// template
template
basic_fstream
::basic_fstream(const Path & file_ph, typename boost::enable_if
>::type* ) : std::basic_fstream
( detail::path_proxy( file_ph.external_file_string(), std::ios_base::in|std::ios_base::out ).c_str(), std::ios_base::in|std::ios_base::out ) {} template
basic_fstream
::basic_fstream( const wpath & file_ph ) : std::basic_fstream
( detail::path_proxy( file_ph.external_file_string(), std::ios_base::in|std::ios_base::out ).c_str(), std::ios_base::in|std::ios_base::out ) {} template
template
basic_fstream
::basic_fstream( const Path & file_ph, std::ios_base::openmode mode, typename boost::enable_if
>::type* ) : std::basic_fstream
( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {} template
basic_fstream
::basic_fstream( const wpath & file_ph, std::ios_base::openmode mode ) : std::basic_fstream
( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {} template
template
typename boost::enable_if
, void>::type basic_fstream
::open( const Path & file_ph ) { std::basic_fstream
::open( detail::path_proxy( file_ph.external_file_string(), std::ios_base::in|std::ios_base::out ).c_str(), std::ios_base::in|std::ios_base::out ); } template
void basic_fstream
::open( const wpath & file_ph ) { std::basic_fstream
::open( detail::path_proxy( file_ph.external_file_string(), std::ios_base::in|std::ios_base::out ).c_str(), std::ios_base::in|std::ios_base::out ); } template
template
typename boost::enable_if
, void>::type basic_fstream
::open( const Path & file_ph, std::ios_base::openmode mode ) { std::basic_fstream
::open( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ); } template
void basic_fstream
::open( const wpath & file_ph, std::ios_base::openmode mode ) { std::basic_fstream
::open( detail::path_proxy( file_ph.external_file_string(), mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ); } # endif # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this template
basic_filebuf
* basic_filebuf
::open( const path & file_ph, std::ios_base::openmode mode ) { return std::basic_filebuf
::open( file_ph.file_string().c_str(), mode ) == 0 ? 0 : this; } # endif template
basic_ifstream
::basic_ifstream( const path & file_ph ) : std::basic_ifstream
( file_ph.file_string().c_str(), std::ios_base::in ) {} template
basic_ifstream
::basic_ifstream( const path & file_ph, std::ios_base::openmode mode ) : std::basic_ifstream
( file_ph.file_string().c_str(), mode ) {} # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this template
void basic_ifstream
::open( const path & file_ph ) { std::basic_ifstream
::open( file_ph.file_string().c_str(), std::ios_base::in ); } template
void basic_ifstream
::open( const path & file_ph, std::ios_base::openmode mode ) { std::basic_ifstream
::open( file_ph.file_string().c_str(), mode ); } # endif template
basic_ofstream
::basic_ofstream( const path & file_ph ) : std::basic_ofstream
( file_ph.file_string().c_str(), std::ios_base::out ) {} template
basic_ofstream
::basic_ofstream( const path & file_ph, std::ios_base::openmode mode ) : std::basic_ofstream
( file_ph.file_string().c_str(), mode ) {} # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this template
void basic_ofstream
::open( const path & file_ph ) { std::basic_ofstream
::open( file_ph.file_string().c_str(), std::ios_base::out ); } template
void basic_ofstream
::open( const path & file_ph, std::ios_base::openmode mode ) { std::basic_ofstream
::open( file_ph.file_string().c_str(), mode ); } # endif template
basic_fstream
::basic_fstream( const path & file_ph ) : std::basic_fstream
( file_ph.file_string().c_str(), std::ios_base::in|std::ios_base::out ) {} template
basic_fstream
::basic_fstream( const path & file_ph, std::ios_base::openmode mode ) : std::basic_fstream
( file_ph.file_string().c_str(), mode ) {} # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this template
void basic_fstream
::open( const path & file_ph ) { std::basic_fstream
::open( file_ph.file_string().c_str(), std::ios_base::in|std::ios_base::out ); } template
void basic_fstream
::open( const path & file_ph, std::ios_base::openmode mode ) { std::basic_fstream
::open( file_ph.file_string().c_str(), mode ); } # endif } // namespace filesystem } // namespace boost #include
// pops abi_prefix.hpp pragmas #endif // BOOST_FILESYSTEM_FSTREAM_HPP
fstream.hpp
网页地址
文件地址
上一页
4/6
下一页
下载
( 22 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.