From fa89055f13726dcc07f9fe14b5f1e8a7af210d61 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 22 Dec 2015 15:46:13 +0100 Subject: shuffle compressor-specific code into private subclasses This isn't implementing any new features, it is "just" moving code around from FileFd methods which decided on each call how to handle the request by including all logic for all possible compressor backends in the method body to a model in which backend-specifics are implemented in a FileFdPrivate subclass. This avoids a big chunk of #ifdef's and should make it a tiny bit more obvious which backend uses which code. The execution of the idea is slightly uglified by the need to preserve ABI and API which causes liberal befriending. Git-Dch: Ignore --- apt-pkg/contrib/fileutl.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'apt-pkg/contrib/fileutl.h') diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 5809bf1de..57d3ab841 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -41,6 +41,12 @@ using std::string; class FileFdPrivate; class FileFd { + friend class FileFdPrivate; + friend class GzipFileFdPrivate; + friend class Bz2FileFdPrivate; + friend class LzmaFileFdPrivate; + friend class DirectFileFdPrivate; + friend class PipedFileFdPrivate; protected: int iFd; -- cgit v1.2.3