protected:
FileFd * const filefd;
size_t buffersize_max = 0;
- std::unique_ptr<char> buffer;
+ std::unique_ptr<char[]> buffer;
unsigned long long buffersize = 0;
public:
int compressed_fd;
APT::Configuration::Compressor compressor;
unsigned int openmode;
unsigned long long seekpos;
- FileFdPrivate(FileFd * const pfilefd) : filefd(pfilefd), buffer(nullptr),
+ explicit FileFdPrivate(FileFd * const pfilefd) : filefd(pfilefd), buffer(nullptr),
compressed_fd(-1), compressor_pid(-1), is_pipe(false),
openmode(0), seekpos(0) {};
return true;
}
- GzipFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), gz(nullptr) {}
+ explicit GzipFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), gz(nullptr) {}
virtual ~GzipFileFdPrivate() { InternalClose(""); }
#endif
};
return true;
}
- Bz2FileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), bz2(nullptr) {}
+ explicit Bz2FileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), bz2(nullptr) {}
virtual ~Bz2FileFdPrivate() { InternalClose(""); }
#endif
};
return true;
}
- LzmaFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), lzma(nullptr) {}
+ explicit LzmaFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd), lzma(nullptr) {}
virtual ~LzmaFileFdPrivate() { InternalClose(""); }
#endif
};
compressor_pid = -1;
return Ret;
}
- PipedFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {}
+ explicit PipedFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {}
virtual ~PipedFileFdPrivate() { InternalClose(""); }
};
/*}}}*/
virtual bool InternalClose(std::string const &) override { return true; }
virtual bool InternalAlwaysAutoClose() const override { return false; }
- DirectFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {}
+ explicit DirectFileFdPrivate(FileFd * const filefd) : FileFdPrivate(filefd) {}
virtual ~DirectFileFdPrivate() { InternalClose(""); }
};
/*}}}*/