Procházet zdrojové kódy

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 před 10 roky
rodič
revize
fa89055f13
2 změnil soubory, kde provedl 692 přidání a 635 odebrání
  1. 686 635
      apt-pkg/contrib/fileutl.cc
  2. 6 0
      apt-pkg/contrib/fileutl.h

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 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;