Bläddra i källkod

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
David Kalnischkies 10 år sedan
förälder
incheckning
fa89055f13
2 ändrade filer med 692 tillägg och 635 borttagningar
  1. 686 635
      apt-pkg/contrib/fileutl.cc
  2. 6 0
      apt-pkg/contrib/fileutl.h

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 686 - 635
apt-pkg/contrib/fileutl.cc


+ 6 - 0
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;