MCPcopy Create free account
hub / github.com/3rdparty/libprocess / FileEncoder

Method FileEncoder

src/encoder.hpp:236–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234{
235public:
236 FileEncoder(int_fd _fd, size_t _size)
237 : fd(_fd), size(static_cast<off_t>(_size)), index(0)
238 {
239 // NOTE: For files, we expect the size to be derived from `stat`-ing
240 // the file. The `struct stat` returns the size in `off_t` form,
241 // meaning that it is a programmer error to construct the `FileEncoder`
242 // with a size greater the max value of `off_t`.
243 CHECK_LE(_size, static_cast<size_t>(std::numeric_limits<off_t>::max()));
244 }
245
246 ~FileEncoder() override
247 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected