blob: 5440ca3f9eab4ef3b6191af3c475e2f593f881e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# cwrap
_cwrap_ is a collection of C++ wrappers for POSIX C API.
## How to use
Currently it supports only file descriptor.
## Example
- File Descriptor
```cpp
cwrap::Fildes fildes{open(path.c_str(), O_RDONLY)};
if (fildes.get() < 0)
{
std::ostringstream ostr;
ostr << "Error: " << path << " not found" << std::endl;
throw std::runtime_error{ostr.str()};
}
google::protobuf::io::FileInputStream fis(fildes.get());
```
|