! * class: Buffer * This class is a very thin wrapper around std::vector * This is basically used to determine the length of the actual * data stored inside the dynamically resized vector. * * This is what is returned as the output to communicate and check_output * functions, so, users must know about this class. * * OutBuffer and ErrBuffer are just different typedefs to this class.
| 1055 | * OutBuffer and ErrBuffer are just different typedefs to this class. |
| 1056 | */ |
| 1057 | class Buffer |
| 1058 | { |
| 1059 | public: |
| 1060 | Buffer() {} |
| 1061 | explicit Buffer(size_t cap) { buf.resize(cap); } |
| 1062 | void add_cap(size_t cap) { buf.resize(cap); } |
| 1063 | |
| 1064 | #if 0 |
| 1065 | Buffer(const Buffer& other): |
| 1066 | buf(other.buf), |
| 1067 | length(other.length) |
| 1068 | { |
| 1069 | std::cout << "COPY" << std::endl; |
| 1070 | } |
| 1071 | |
| 1072 | Buffer(Buffer&& other): |
| 1073 | buf(std::move(other.buf)), |
| 1074 | length(other.length) |
| 1075 | { |
| 1076 | std::cout << "MOVE" << std::endl; |
| 1077 | } |
| 1078 | #endif |
| 1079 | |
| 1080 | public: |
| 1081 | std::vector<char> buf; |
| 1082 | size_t length = 0; |
| 1083 | }; |
| 1084 | |
| 1085 | // Buffer for storing output written to output fd |
| 1086 | using OutBuffer = Buffer; |
nothing calls this directly
no outgoing calls
no test coverage detected