哪些异常会导致mapped_file_source抛出
What exceptions does boost mapped_file_source throw?
Boost mapped_file_source似乎在例如找不到文件的情况下抛出异常。它到底抛出了哪些异常类?文件中似乎没有写,除非我遗漏了什么。
编辑:测试用例:
#include <boost/iostreams/device/mapped_file.hpp>
int main(int argc, char** argv) {
boost::iostreams::mapped_file_source file;
file.open(argv[1]);
return 0;
}
如果映射失败,代码
mapped_handle_ =
::CreateFileMappingA(
handle_,
NULL,
protect,
0,
0,
NULL );
if (mapped_handle_ == NULL)
cleanup_and_throw("failed create mapping");
最终会抛出
boost::iostreams::detail::throw_system_failure(msg);
即CCD_ 1的子类。在这种情况下,它应该是std::ios::failure
:
BOOST_IOSTREAMS_FAILURE
扩展到std::ios_base::failure(如果可用),并扩展到合适的std:的派生类:否则为异常。
参考:http://www.boost.org/doc/libs/1_41_0/libs/iostreams/src/mapped_file.cpp
相关文章:
- Seg Fault Issue C++ (file IO / getline)
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- Android NDK clang 编译器错误在 Windows 上显示'No such file or directory'
- File.cpp.o:OpenPose 标志 CMakeFiles/.. 的多重定义/main.cpp.o:首先在这里定
- Visual Studio C++ Project File CustomBuild Task: Filter Outp
- 已解决 - C++ 的崇高文本中的"fatal error: opencv: no such file or directory"
- 可视化 如何在C++中将字符数组转换为 FILE 类型
- 如何在从文件中读取整数时使用 file.eof()?
- "No such file or directory" C++标头问题
- 使用 sftp_open() 使用 C++ 中的 SFTP libssh 将文件从本地复制到远程时,File 返回 N
- Visual Studio "fatal error LNK1104: cannot open file"未使用或包含的库
- typedef vector size_type in header file
- make 命令创建 .file,但不创建应用程序文件
- 为什么 VScode 在 .h 文件中显示"'iostream' file not found"?
- 我在 #include < bits/stdc++h.> 放置时出错"No such file or directory"
- VS 2017 C++ - "cannot open source file 'sqlite3.h' "
- 进口。TLB文件给出"cannot open source file x.tlh"
- "cannot open source file bits/stdc++.h"在Visual Studio中
- 已安装 SDK 的头文件的"Cannot open source file"
- 如何修复此错误:#include < gl/glut.h> "Cannot open source file gl/glut.h"