mirror of
https://github.com/vimpunk/mio.git
synced 2025-12-06 16:57:01 +08:00
Update docs to specify exception type
This commit is contained in:
parent
a345b8b92d
commit
d33a0d567f
@ -20,7 +20,7 @@ NOTE: the file must exist before creating a mapping.
|
|||||||
|
|
||||||
There are three ways to map a file into memory:
|
There are three ways to map a file into memory:
|
||||||
|
|
||||||
- Using the constructor, which throws on failure:
|
- Using the constructor, which throws a `std::system_error` on failure:
|
||||||
```c++
|
```c++
|
||||||
mio::mmap_source mmap(path, offset, size_to_map);
|
mio::mmap_source mmap(path, offset, size_to_map);
|
||||||
```
|
```
|
||||||
|
|||||||
@ -104,8 +104,9 @@ public:
|
|||||||
basic_mmap() = default;
|
basic_mmap() = default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The same as invoking the `map` function, except any error that may occur while
|
* The same as invoking the `map` function, except any error that may occur
|
||||||
* establishing the mapping is thrown.
|
* while establishing the mapping is wrapped in a `std::system_error` and is
|
||||||
|
* thrown.
|
||||||
*/
|
*/
|
||||||
template<typename String>
|
template<typename String>
|
||||||
basic_mmap(const String& path, const size_type offset = 0, const size_type length = map_entire_file)
|
basic_mmap(const String& path, const size_type offset = 0, const size_type length = map_entire_file)
|
||||||
@ -116,8 +117,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The same as invoking the `map` function, except any error that may occur while
|
* The same as invoking the `map` function, except any error that may occur
|
||||||
* establishing the mapping is thrown.
|
* while establishing the mapping is wrapped in a `std::system_error` and is
|
||||||
|
* thrown.
|
||||||
*/
|
*/
|
||||||
basic_mmap(const handle_type handle, const size_type offset = 0, const size_type length = map_entire_file)
|
basic_mmap(const handle_type handle, const size_type offset = 0, const size_type length = map_entire_file)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -88,8 +88,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The same as invoking the `map` function, except any error that may occur while
|
* The same as invoking the `map` function, except any error that may occur
|
||||||
* establishing the mapping is thrown.
|
* while establishing the mapping is wrapped in a `std::system_error` and is
|
||||||
|
* thrown.
|
||||||
*/
|
*/
|
||||||
template<typename String>
|
template<typename String>
|
||||||
basic_shared_mmap(const String& path, const size_type offset = 0, const size_type length = map_entire_file)
|
basic_shared_mmap(const String& path, const size_type offset = 0, const size_type length = map_entire_file)
|
||||||
@ -100,8 +101,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The same as invoking the `map` function, except any error that may occur while
|
* The same as invoking the `map` function, except any error that may occur
|
||||||
* establishing the mapping is thrown.
|
* while establishing the mapping is wrapped in a `std::system_error` and is
|
||||||
|
* thrown.
|
||||||
*/
|
*/
|
||||||
basic_shared_mmap(const handle_type handle, const size_type offset = 0, const size_type length = map_entire_file)
|
basic_shared_mmap(const handle_type handle, const size_type offset = 0, const size_type length = map_entire_file)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user