Explorar el Código

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 hace 10 años
padre
commit
fa89055f13
Se han modificado 2 ficheros con 692 adiciones y 635 borrados
  1. 686 635
      apt-pkg/contrib/fileutl.cc
  2. 6 0
      apt-pkg/contrib/fileutl.h

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 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;