x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
system_failure.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\iostreams\detail\system_failure.hpp
旋转
特效
属性
历史版本
// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) // (C) Copyright 2005-2007 Jonathan Turkanis // (C) Copyright Jonathan Graehl 2004. // Distributed under 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 http://www.boost.org/libs/iostreams for documentation. // Used by mapped_file.cpp. #ifndef BOOST_IOSTREAMS_DETAIL_SYSTEM_FAILURE_HPP_INCLUDED #define BOOST_IOSTREAMS_DETAIL_SYSTEM_FAILURE_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
#include
#include
#include
#include
// failure. #if defined(BOOST_NO_STDC_NAMESPACE) && !defined(__LIBCOMO__) namespace std { using ::strlen; } #endif #ifdef BOOST_IOSTREAMS_WINDOWS # define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers # include
#else # include
# include
#endif namespace boost { namespace iostreams { namespace detail { inline BOOST_IOSTREAMS_FAILURE system_failure(const char* msg) { std::string result; #ifdef BOOST_IOSTREAMS_WINDOWS DWORD err; LPVOID lpMsgBuf; if ( (err = ::GetLastError()) != NO_ERROR && ::FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR) &lpMsgBuf, 0, NULL ) != 0 ) { result.reserve(std::strlen(msg) + 2 + std::strlen((LPSTR)lpMsgBuf)); result.append(msg); result.append(": "); result.append((LPSTR) lpMsgBuf); ::LocalFree(lpMsgBuf); } else { result += msg; } #else const char* system_msg = errno ? strerror(errno) : ""; result.reserve(std::strlen(msg) + 2 + std::strlen(system_msg)); result.append(msg); result.append(": "); result.append(system_msg); #endif return BOOST_IOSTREAMS_FAILURE(result); } inline BOOST_IOSTREAMS_FAILURE system_failure(const std::string& msg) { return system_failure(msg.c_str()); } inline void throw_system_failure(const char* msg) { throw system_failure(msg); } inline void throw_system_failure(const std::string& msg) { throw system_failure(msg); } } } } // End namespaces detail, iostreams, boost. #endif // #ifndef BOOST_IOSTREAMS_DETAIL_SYSTEM_FAILURE_HPP_INCLUDED
system_failure.hpp
网页地址
文件地址
上一页
35/38
下一页
下载
( 2 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.