Quellcode durchsuchen

use forward declaration in headers if possible instead of includes

David Kalnischkies vor 15 Jahren
Ursprung
Commit
472ff00ef2
99 geänderte Dateien mit 380 neuen und 232 gelöschten Zeilen
  1. 1 0
      apt-inst/contrib/arfile.cc
  2. 2 1
      apt-inst/contrib/arfile.h
  3. 1 0
      apt-inst/contrib/extracttar.cc
  4. 3 2
      apt-inst/contrib/extracttar.h
  5. 7 0
      apt-inst/database.cc
  6. 6 2
      apt-inst/database.h
  7. 1 0
      apt-inst/deb/debfile.cc
  8. 4 1
      apt-inst/deb/debfile.h
  9. 2 0
      apt-inst/deb/dpkgdb.cc
  10. 5 0
      apt-inst/deb/dpkgdb.h
  11. 1 0
      apt-inst/extract.cc
  12. 2 1
      apt-inst/filelist.h
  13. 2 0
      apt-pkg/acquire-item.cc
  14. 119 119
      apt-pkg/acquire-item.h
  15. 3 3
      apt-pkg/acquire-method.h
  16. 3 0
      apt-pkg/algorithms.cc
  17. 2 1
      apt-pkg/algorithms.h
  18. 1 0
      apt-pkg/cachefile.cc
  19. 5 4
      apt-pkg/cachefile.h
  20. 1 0
      apt-pkg/cacheiterators.h
  21. 5 2
      apt-pkg/cacheset.cc
  22. 8 5
      apt-pkg/cacheset.h
  23. 2 0
      apt-pkg/cdrom.cc
  24. 2 1
      apt-pkg/cdrom.h
  25. 1 0
      apt-pkg/clean.cc
  26. 1 0
      apt-pkg/contrib/cmndline.cc
  27. 1 3
      apt-pkg/contrib/cmndline.h
  28. 1 0
      apt-pkg/contrib/mmap.cc
  29. 2 1
      apt-pkg/contrib/mmap.h
  30. 2 0
      apt-pkg/contrib/netrc.cc
  31. 3 1
      apt-pkg/contrib/netrc.h
  32. 1 0
      apt-pkg/deb/deblistparser.cc
  33. 0 1
      apt-pkg/deb/deblistparser.h
  34. 3 0
      apt-pkg/deb/debmetaindex.cc
  35. 22 21
      apt-pkg/deb/debmetaindex.h
  36. 2 0
      apt-pkg/deb/debrecords.cc
  37. 1 1
      apt-pkg/deb/debrecords.h
  38. 3 1
      apt-pkg/deb/debsystem.h
  39. 1 1
      apt-pkg/depcache.cc
  40. 3 2
      apt-pkg/depcache.h
  41. 7 0
      apt-pkg/edsp.cc
  42. 8 3
      apt-pkg/edsp.h
  43. 1 0
      apt-pkg/edsp/edspindexfile.cc
  44. 0 1
      apt-pkg/edsp/edspindexfile.h
  45. 2 3
      apt-pkg/edsp/edsplistparser.h
  46. 2 0
      apt-pkg/indexfile.h
  47. 3 0
      apt-pkg/indexrecords.cc
  48. 0 1
      apt-pkg/indexrecords.h
  49. 2 0
      apt-pkg/init.cc
  50. 2 2
      apt-pkg/init.h
  51. 0 3
      apt-pkg/metaindex.h
  52. 1 2
      apt-pkg/packagemanager.h
  53. 2 0
      apt-pkg/pkgcachegen.cc
  54. 4 2
      apt-pkg/pkgsystem.h
  55. 2 0
      apt-pkg/sourcelist.cc
  56. 4 2
      apt-pkg/sourcelist.h
  57. 1 0
      apt-pkg/srcrecords.cc
  58. 1 0
      apt-pkg/tagfile.cc
  59. 4 2
      apt-pkg/tagfile.h
  60. 2 0
      apt-pkg/vendorlist.cc
  61. 3 2
      apt-pkg/vendorlist.h
  62. 1 2
      apt-pkg/version.h
  63. 3 1
      cmdline/acqprogress.h
  64. 5 1
      cmdline/apt-cache.cc
  65. 2 0
      cmdline/apt-cdrom.cc
  66. 1 0
      cmdline/apt-config.cc
  67. 1 0
      cmdline/apt-dump-solver.cc
  68. 1 0
      cmdline/apt-extracttemplates.cc
  69. 5 0
      cmdline/apt-get.cc
  70. 2 0
      cmdline/apt-internal-solver.cc
  71. 1 0
      cmdline/apt-mark.cc
  72. 2 0
      cmdline/apt-sortpkgs.cc
  73. 2 1
      debian/changelog
  74. 1 0
      ftparchive/cachedb.cc
  75. 4 4
      ftparchive/cachedb.h
  76. 2 1
      ftparchive/contents.h
  77. 2 3
      ftparchive/multicompress.h
  78. 3 2
      ftparchive/writer.h
  79. 1 0
      methods/bzip2.cc
  80. 1 0
      methods/cdrom.cc
  81. 2 0
      methods/connect.cc
  82. 2 1
      methods/connect.h
  83. 1 0
      methods/copy.cc
  84. 1 0
      methods/file.cc
  85. 1 0
      methods/ftp.cc
  86. 4 0
      methods/ftp.h
  87. 1 0
      methods/gpgv.cc
  88. 6 0
      methods/http.cc
  89. 5 2
      methods/http.h
  90. 1 0
      methods/https.cc
  91. 2 1
      methods/https.h
  92. 2 1
      methods/mirror.cc
  93. 13 12
      methods/mirror.h
  94. 1 0
      methods/rred.cc
  95. 3 0
      methods/rsh.cc
  96. 5 3
      methods/rsh.h
  97. 1 0
      test/interactive-helper/extract-control.cc
  98. 1 0
      test/interactive-helper/test_udevcdrom.cc
  99. 2 0
      test/interactive-helper/testextract.cc

+ 1 - 0
apt-inst/contrib/arfile.cc

@@ -18,6 +18,7 @@
 
 #include <apt-pkg/arfile.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
 #include <apt-pkg/error.h>
 
 #include <stdlib.h>

+ 2 - 1
apt-inst/contrib/arfile.h

@@ -17,7 +17,8 @@
 
 
 #include <string>
-#include <apt-pkg/fileutl.h>
+
+class FileFd;
 
 class ARArchive
 {

+ 1 - 0
apt-inst/contrib/extracttar.cc

@@ -18,6 +18,7 @@
 // Include Files							/*{{{*/
 #include<config.h>
 
+#include <apt-pkg/dirstream.h>
 #include <apt-pkg/extracttar.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>

+ 3 - 2
apt-inst/contrib/extracttar.h

@@ -15,9 +15,10 @@
 #define PKGLIB_EXTRACTTAR_H
 
 #include <apt-pkg/fileutl.h>
-#include <apt-pkg/dirstream.h>
 
-#include <algorithm>
+#include <string>
+
+class pkgDirStream;
 
 class ExtractTar
 {

+ 7 - 0
apt-inst/database.cc

@@ -11,6 +11,8 @@
 #include<config.h>
 
 #include <apt-pkg/database.h>
+#include <apt-pkg/filelist.h>
+#include <apt-pkg/pkgcachegen.h>
 									/*}}}*/
 
 // DataBase::GetMetaTmp - Get the temp dir				/*{{{*/
@@ -26,3 +28,8 @@ bool pkgDataBase::GetMetaTmp(std::string &Dir)
    return true;
 }
 									/*}}}*/
+pkgDataBase::~pkgDataBase()
+{
+   delete Cache;
+   delete FList;
+}

+ 6 - 2
apt-inst/database.h

@@ -21,9 +21,13 @@
 #ifndef PKGLIB_DATABASE_H
 #define PKGLIB_DATABASE_H
 
-#include <apt-pkg/filelist.h>
 #include <apt-pkg/pkgcachegen.h>
 
+#include <string>
+
+class pkgFLCache;
+class OpProgress;
+
 class pkgDataBase
 {
    protected:
@@ -46,7 +50,7 @@ class pkgDataBase
    virtual bool LoadChanges() = 0;
 
    pkgDataBase() : Cache(0), FList(0) {};
-   virtual ~pkgDataBase() {delete Cache; delete FList;};
+   virtual ~pkgDataBase();
 };
 
 #endif

+ 1 - 0
apt-inst/deb/debfile.cc

@@ -18,6 +18,7 @@
 // Include Files							/*{{{*/
 #include<config.h>
 
+#include <apt-pkg/database.h>
 #include <apt-pkg/debfile.h>
 #include <apt-pkg/extracttar.h>
 #include <apt-pkg/error.h>

+ 4 - 1
apt-inst/deb/debfile.h

@@ -25,9 +25,12 @@
 
 
 #include <apt-pkg/arfile.h>
-#include <apt-pkg/database.h>
 #include <apt-pkg/dirstream.h>
 #include <apt-pkg/tagfile.h>
+#include <apt-pkg/pkgcache.h>
+
+class FileFd;
+class pkgDataBase;
 
 class debDebFile
 {

+ 2 - 0
apt-inst/deb/dpkgdb.cc

@@ -21,6 +21,8 @@
 #include <apt-pkg/progress.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/filelist.h>
 
 #include <stdio.h>
 #include <errno.h>

+ 5 - 0
apt-inst/deb/dpkgdb.h

@@ -22,6 +22,11 @@
 
 #include <apt-pkg/database.h>
 
+#include <string>
+
+class DynamicMMap;
+class OpProgress;
+
 class debDpkgDB : public pkgDataBase
 {
    protected:

+ 1 - 0
apt-inst/extract.cc

@@ -49,6 +49,7 @@
 #include <apt-pkg/extract.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/debversion.h>
+#include <apt-pkg/fileutl.h>
 
 #include <sys/stat.h>
 #include <stdio.h>

+ 2 - 1
apt-inst/filelist.h

@@ -28,9 +28,10 @@
 #ifndef PKGLIB_FILELIST_H
 #define PKGLIB_FILELIST_H
 
+#include <apt-pkg/mmap.h>
 
 #include <cstring>
-#include <apt-pkg/mmap.h>
+#include <string>
 
 class pkgFLCache
 {

+ 2 - 0
apt-pkg/acquire-item.cc

@@ -25,6 +25,8 @@
 #include <apt-pkg/md5.h>
 #include <apt-pkg/sha1.h>
 #include <apt-pkg/tagfile.h>
+#include <apt-pkg/indexrecords.h>
+#include <apt-pkg/metaindex.h>
 
 #include <sys/stat.h>
 #include <unistd.h>

+ 119 - 119
apt-pkg/acquire-item.h

@@ -21,13 +21,9 @@
 #define PKGLIB_ACQUIRE_ITEM_H
 
 #include <apt-pkg/acquire.h>
-#include <apt-pkg/indexfile.h>
-#include <apt-pkg/vendor.h>
-#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/indexrecords.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/weakptr.h>
+#include <apt-pkg/pkgcache.h>
 
 /** \addtogroup acquire
  *  @{
@@ -35,6 +31,10 @@
  *  \file acquire-item.h
  */
 
+class indexRecords;
+class pkgRecords;
+class pkgSourceList;
+
 /** \brief Represents the process by which a pkgAcquire object should	{{{
  *  retrieve a file or a collection of files.
  *
@@ -74,7 +74,7 @@ class pkgAcquire::Item : public WeakPointable
     *  \param To The new name of #From.  If #To exists it will be
     *  overwritten.
     */
-   void Rename(string From,string To);
+   void Rename(std::string From,std::string To);
    
    public:
 
@@ -109,7 +109,7 @@ class pkgAcquire::Item : public WeakPointable
    /** \brief Contains a textual description of the error encountered
     *  if #Status is #StatError or #StatAuthError.
     */
-   string ErrorText;
+   std::string ErrorText;
 
    /** \brief The size of the object to fetch. */
    unsigned long long FileSize;
@@ -143,7 +143,7 @@ class pkgAcquire::Item : public WeakPointable
     *  download progress indicator's overall statistics.
     */
    bool Local;
-   string UsedMirror;
+   std::string UsedMirror;
 
    /** \brief The number of fetch queues into which this item has been
     *  inserted.
@@ -158,7 +158,7 @@ class pkgAcquire::Item : public WeakPointable
    /** \brief The name of the file into which the retrieved object
     *  will be written.
     */
-   string DestFile;
+   std::string DestFile;
 
    /** \brief Invoked by the acquire worker when the object couldn't
     *  be fetched.
@@ -173,7 +173,7 @@ class pkgAcquire::Item : public WeakPointable
     *
     *  \sa pkgAcqMethod
     */
-   virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
 
    /** \brief Invoked by the acquire worker when the object was
     *  fetched successfully.
@@ -194,7 +194,7 @@ class pkgAcquire::Item : public WeakPointable
     *
     *  \sa pkgAcqMethod
     */
-   virtual void Done(string Message,unsigned long long Size,string Hash,
+   virtual void Done(std::string Message,unsigned long long Size,std::string Hash,
 		     pkgAcquire::MethodConfig *Cnf);
 
    /** \brief Invoked when the worker starts to fetch this object.
@@ -206,7 +206,7 @@ class pkgAcquire::Item : public WeakPointable
     *
     *  \sa pkgAcqMethod
     */
-   virtual void Start(string Message,unsigned long long Size);
+   virtual void Start(std::string Message,unsigned long long Size);
 
    /** \brief Custom headers to be sent to the fetch process.
     *
@@ -216,18 +216,18 @@ class pkgAcquire::Item : public WeakPointable
     *  line, so they should (if nonempty) have a leading newline and
     *  no trailing newline.
     */
-   virtual string Custom600Headers() {return string();};
+   virtual std::string Custom600Headers() {return std::string();};
 
    /** \brief A "descriptive" URI-like string.
     *
     *  \return a URI that should be used to describe what is being fetched.
     */
-   virtual string DescURI() = 0;
+   virtual std::string DescURI() = 0;
    /** \brief Short item description.
     *
     *  \return a brief description of the object being fetched.
     */
-   virtual string ShortDesc() {return DescURI();}
+   virtual std::string ShortDesc() {return DescURI();}
 
    /** \brief Invoked by the worker when the download is completely done. */
    virtual void Finished() {};
@@ -237,7 +237,7 @@ class pkgAcquire::Item : public WeakPointable
     *  \return the HashSum of this object, if applicable; otherwise, an
     *  empty string.
     */
-   virtual string HashSum() {return string();};
+   virtual std::string HashSum() {return std::string();};
 
    /** \return the acquire process with which this item is associated. */
    pkgAcquire *GetOwner() {return Owner;};
@@ -253,7 +253,7 @@ class pkgAcquire::Item : public WeakPointable
     * 
     *  \param FailCode A short failure string that is send
     */
-   void ReportMirrorFailure(string FailCode);
+   void ReportMirrorFailure(std::string FailCode);
 
 
    /** \brief Initialize an item.
@@ -278,10 +278,10 @@ class pkgAcquire::Item : public WeakPointable
 /** \brief Information about an index patch (aka diff). */		/*{{{*/
 struct DiffInfo {
    /** The filename of the diff. */
-   string file;
+   std::string file;
 
    /** The sha1 hash of the diff. */
-   string sha1;
+   std::string sha1;
 
    /** The size of the diff. */
    unsigned long size;
@@ -308,12 +308,12 @@ class pkgAcqSubIndex : public pkgAcquire::Item
 
  public:
    // Specialized action members
-   virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
-   virtual void Done(string Message,unsigned long long Size,string Md5Hash,
+   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
 		     pkgAcquire::MethodConfig *Cnf);
-   virtual string DescURI() {return Desc.URI;};
-   virtual string Custom600Headers();
-   virtual bool ParseIndex(string const &IndexFile);
+   virtual std::string DescURI() {return Desc.URI;};
+   virtual std::string Custom600Headers();
+   virtual bool ParseIndex(std::string const &IndexFile);
 
    /** \brief Create a new pkgAcqSubIndex.
     *
@@ -327,8 +327,8 @@ class pkgAcqSubIndex : public pkgAcquire::Item
     *
     *  \param ExpectedHash The list file's MD5 signature.
     */
-   pkgAcqSubIndex(pkgAcquire *Owner, string const &URI,string const &URIDesc,
-		   string const &ShortDesc, HashString const &ExpectedHash);
+   pkgAcqSubIndex(pkgAcquire *Owner, std::string const &URI,std::string const &URIDesc,
+		   std::string const &ShortDesc, HashString const &ExpectedHash);
 };
 									/*}}}*/
 /** \brief An item that is responsible for fetching an index file of	{{{
@@ -352,7 +352,7 @@ class pkgAcqDiffIndex : public pkgAcquire::Item
    /** \brief The URI of the index file to recreate at our end (either
     *  by downloading it or by applying partial patches).
     */
-   string RealURI;
+   std::string RealURI;
 
    /** \brief The Hash that the real index file should have after
     *  all patches have been applied.
@@ -362,20 +362,20 @@ class pkgAcqDiffIndex : public pkgAcquire::Item
    /** \brief The index file which will be patched to generate the new
     *  file.
     */
-   string CurrentPackagesFile;
+   std::string CurrentPackagesFile;
 
    /** \brief A description of the Packages file (stored in
     *  pkgAcquire::ItemDesc::Description).
     */
-   string Description;
+   std::string Description;
 
  public:
    // Specialized action members
-   virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
-   virtual void Done(string Message,unsigned long long Size,string Md5Hash,
+   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
 		     pkgAcquire::MethodConfig *Cnf);
-   virtual string DescURI() {return RealURI + "Index";};
-   virtual string Custom600Headers();
+   virtual std::string DescURI() {return RealURI + "Index";};
+   virtual std::string Custom600Headers();
 
    /** \brief Parse the Index file for a set of Packages diffs.
     *
@@ -387,7 +387,7 @@ class pkgAcqDiffIndex : public pkgAcquire::Item
     *  \return \b true if the Index file was successfully parsed, \b
     *  false otherwise.
     */
-   bool ParseDiffIndex(string IndexDiffFile);
+   bool ParseDiffIndex(std::string IndexDiffFile);
    
 
    /** \brief Create a new pkgAcqDiffIndex.
@@ -402,8 +402,8 @@ class pkgAcqDiffIndex : public pkgAcquire::Item
     *
     *  \param ExpectedHash The list file's MD5 signature.
     */
-   pkgAcqDiffIndex(pkgAcquire *Owner,string URI,string URIDesc,
-		   string ShortDesc, HashString ExpectedHash);
+   pkgAcqDiffIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc,
+		   std::string ShortDesc, HashString ExpectedHash);
 };
 									/*}}}*/
 /** \brief An item that is responsible for fetching all the patches	{{{
@@ -460,7 +460,7 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item
    /** \brief The URI of the package index file that is being
     *  reconstructed.
     */
-   string RealURI;
+   std::string RealURI;
 
    /** \brief The HashSum of the package index file that is being
     *  reconstructed.
@@ -468,7 +468,7 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item
    HashString ExpectedHash;
 
    /** A description of the file being downloaded. */
-   string Description;
+   std::string Description;
 
    /** The patches that remain to be downloaded, including the patch
     *  being downloaded right now.  This list should be ordered so
@@ -478,10 +478,10 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item
     *  dictionary instead of relying on ordering and stripping them
     *  off the front?
     */
-   vector<DiffInfo> available_patches;
+   std::vector<DiffInfo> available_patches;
 
    /** Stop applying patches when reaching that sha1 */
-   string ServerSha1;
+   std::string ServerSha1;
 
    /** The current status of this patch. */
    enum DiffState
@@ -506,11 +506,11 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item
     *  This method will fall back to downloading the whole index file
     *  outright; its arguments are ignored.
     */
-   virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
 
-   virtual void Done(string Message,unsigned long long Size,string Md5Hash,
+   virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
 		     pkgAcquire::MethodConfig *Cnf);
-   virtual string DescURI() {return RealURI + "Index";};
+   virtual std::string DescURI() {return RealURI + "Index";};
 
    /** \brief Create an index diff item.
     *
@@ -534,10 +534,10 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item
     *  should be ordered so that each diff appears before any diff
     *  that depends on it.
     */
-   pkgAcqIndexDiffs(pkgAcquire *Owner,string URI,string URIDesc,
-		    string ShortDesc, HashString ExpectedHash,
-		    string ServerSha1,
-		    vector<DiffInfo> diffs=vector<DiffInfo>());
+   pkgAcqIndexDiffs(pkgAcquire *Owner,std::string URI,std::string URIDesc,
+		    std::string ShortDesc, HashString ExpectedHash,
+		    std::string ServerSha1,
+		    std::vector<DiffInfo> diffs=std::vector<DiffInfo>());
 };
 									/*}}}*/
 /** \brief An acquire item that is responsible for fetching an index	{{{
@@ -577,7 +577,7 @@ class pkgAcqIndex : public pkgAcquire::Item
    /** \brief The object that is actually being fetched (minus any
     *  compression-related extensions).
     */
-   string RealURI;
+   std::string RealURI;
 
    /** \brief The expected hashsum of the decompressed index file. */
    HashString ExpectedHash;
@@ -585,17 +585,17 @@ class pkgAcqIndex : public pkgAcquire::Item
    /** \brief The compression-related file extensions that are being
     *  added to the downloaded file one by one if first fails (e.g., "gz bz2").
     */
-   string CompressionExtension;
+   std::string CompressionExtension;
 
    public:
    
    // Specialized action members
-   virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
-   virtual void Done(string Message,unsigned long long Size,string Md5Hash,
+   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
 		     pkgAcquire::MethodConfig *Cnf);
-   virtual string Custom600Headers();
-   virtual string DescURI() {return Desc.URI;};
-   virtual string HashSum() {return ExpectedHash.toStr(); };
+   virtual std::string Custom600Headers();
+   virtual std::string DescURI() {return Desc.URI;};
+   virtual std::string HashSum() {return ExpectedHash.toStr(); };
 
    /** \brief Create a pkgAcqIndex.
     *
@@ -616,12 +616,12 @@ class pkgAcqIndex : public pkgAcquire::Item
     *  default is ".lzma" or ".bz2" (if the needed binaries are present)
     *  fallback is ".gz" or none.
     */
-   pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc,
-	       string ShortDesc, HashString ExpectedHash, 
-	       string compressExt="");
+   pkgAcqIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc,
+	       std::string ShortDesc, HashString ExpectedHash, 
+	       std::string compressExt="");
    pkgAcqIndex(pkgAcquire *Owner, struct IndexTarget const * const Target,
 			 HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
-   void Init(string const &URI, string const &URIDesc, string const &ShortDesc);
+   void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc);
 };
 									/*}}}*/
 /** \brief An acquire item that is responsible for fetching a		{{{
@@ -635,8 +635,8 @@ class pkgAcqIndexTrans : public pkgAcqIndex
 {
    public:
   
-   virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
-   virtual string Custom600Headers();
+   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual std::string Custom600Headers();
 
    /** \brief Create a pkgAcqIndexTrans.
     *
@@ -649,8 +649,8 @@ class pkgAcqIndexTrans : public pkgAcqIndex
     *
     *  \param ShortDesc A brief description of this index file.
     */
-   pkgAcqIndexTrans(pkgAcquire *Owner,string URI,string URIDesc,
-		    string ShortDesc);
+   pkgAcqIndexTrans(pkgAcquire *Owner,std::string URI,std::string URIDesc,
+		    std::string ShortDesc);
    pkgAcqIndexTrans(pkgAcquire *Owner, struct IndexTarget const * const Target,
 		    HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
 };
@@ -660,18 +660,18 @@ class IndexTarget
 {
  public:
    /** \brief A URI from which the index file can be downloaded. */
-   string URI;
+   std::string URI;
 
    /** \brief A description of the index file. */
-   string Description;
+   std::string Description;
 
    /** \brief A shorter description of the index file. */
-   string ShortDesc;
+   std::string ShortDesc;
 
    /** \brief The key by which this index file should be
     *  looked up within the meta signature file.
     */
-   string MetaKey;
+   std::string MetaKey;
 
    virtual bool IsOptional() const {
       return false;
@@ -710,7 +710,7 @@ class pkgAcqMetaSig : public pkgAcquire::Item
 {
    protected:
    /** \brief The last good signature file */
-   string LastGoodSig;
+   std::string LastGoodSig;
 
    /** \brief The fetch request that is currently being processed. */
    pkgAcquire::ItemDesc Desc;
@@ -719,20 +719,20 @@ class pkgAcqMetaSig : public pkgAcquire::Item
     *  never modified; it is used to determine the file that is being
     *  downloaded.
     */
-   string RealURI;
+   std::string RealURI;
 
    /** \brief The URI of the meta-index file to be fetched after the signature. */
-   string MetaIndexURI;
+   std::string MetaIndexURI;
 
    /** \brief A "URI-style" description of the meta-index file to be
     *  fetched after the signature.
     */
-   string MetaIndexURIDesc;
+   std::string MetaIndexURIDesc;
 
    /** \brief A brief description of the meta-index file to be fetched
     *  after the signature.
     */
-   string MetaIndexShortDesc;
+   std::string MetaIndexShortDesc;
 
    /** \brief A package-system-specific parser for the meta-index file. */
    indexRecords* MetaIndexParser;
@@ -742,21 +742,21 @@ class pkgAcqMetaSig : public pkgAcquire::Item
     *
     *  \todo Why a list of pointers instead of a list of structs?
     */
-   const vector<struct IndexTarget*>* IndexTargets;
+   const std::vector<struct IndexTarget*>* IndexTargets;
 
    public:
    
    // Specialized action members
-   virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
-   virtual void Done(string Message,unsigned long long Size,string Md5Hash,
+   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
 		     pkgAcquire::MethodConfig *Cnf);
-   virtual string Custom600Headers();
-   virtual string DescURI() {return RealURI; };
+   virtual std::string Custom600Headers();
+   virtual std::string DescURI() {return RealURI; };
 
    /** \brief Create a new pkgAcqMetaSig. */
-   pkgAcqMetaSig(pkgAcquire *Owner,string URI,string URIDesc, string ShortDesc,
-		 string MetaIndexURI, string MetaIndexURIDesc, string MetaIndexShortDesc,
-		 const vector<struct IndexTarget*>* IndexTargets,
+   pkgAcqMetaSig(pkgAcquire *Owner,std::string URI,std::string URIDesc, std::string ShortDesc,
+		 std::string MetaIndexURI, std::string MetaIndexURIDesc, std::string MetaIndexShortDesc,
+		 const std::vector<struct IndexTarget*>* IndexTargets,
 		 indexRecords* MetaIndexParser);
 };
 									/*}}}*/
@@ -779,17 +779,17 @@ class pkgAcqMetaIndex : public pkgAcquire::Item
    /** \brief The URI that is actually being downloaded; never
     *  modified by pkgAcqMetaIndex.
     */
-   string RealURI;
+   std::string RealURI;
 
    /** \brief The file in which the signature for this index was stored.
     *
     *  If empty, the signature and the md5sums of the individual
     *  indices will not be checked.
     */
-   string SigFile;
+   std::string SigFile;
 
    /** \brief The index files to download. */
-   const vector<struct IndexTarget*>* IndexTargets;
+   const std::vector<struct IndexTarget*>* IndexTargets;
 
    /** \brief The parser for the meta-index file. */
    indexRecords* MetaIndexParser;
@@ -805,7 +805,7 @@ class pkgAcqMetaIndex : public pkgAcquire::Item
     *
     *  \return \b true if no fatal errors were encountered.
     */
-   bool VerifyVendor(string Message);
+   bool VerifyVendor(std::string Message);
 
    /** \brief Called when a file is finished being retrieved.
     *
@@ -816,7 +816,7 @@ class pkgAcqMetaIndex : public pkgAcquire::Item
     *  \param Message The message block received from the fetch
     *  subprocess.
     */
-   void RetrievalDone(string Message);
+   void RetrievalDone(std::string Message);
 
    /** \brief Called when authentication succeeded.
     *
@@ -827,7 +827,7 @@ class pkgAcqMetaIndex : public pkgAcquire::Item
     *  \param Message The message block received from the fetch
     *  subprocess.
     */
-   void AuthDone(string Message);
+   void AuthDone(std::string Message);
 
    /** \brief Starts downloading the individual index files.
     *
@@ -842,17 +842,17 @@ class pkgAcqMetaIndex : public pkgAcquire::Item
    public:
    
    // Specialized action members
-   virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
-   virtual void Done(string Message,unsigned long long Size, string Hash,
+   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual void Done(std::string Message,unsigned long long Size, std::string Hash,
 		     pkgAcquire::MethodConfig *Cnf);
-   virtual string Custom600Headers();
-   virtual string DescURI() {return RealURI; };
+   virtual std::string Custom600Headers();
+   virtual std::string DescURI() {return RealURI; };
 
    /** \brief Create a new pkgAcqMetaIndex. */
    pkgAcqMetaIndex(pkgAcquire *Owner,
-		   string URI,string URIDesc, string ShortDesc,
-		   string SigFile,
-		   const vector<struct IndexTarget*>* IndexTargets,
+		   std::string URI,std::string URIDesc, std::string ShortDesc,
+		   std::string SigFile,
+		   const std::vector<struct IndexTarget*>* IndexTargets,
 		   indexRecords* MetaIndexParser);
 };
 									/*}}}*/
@@ -860,33 +860,33 @@ class pkgAcqMetaIndex : public pkgAcquire::Item
 class pkgAcqMetaClearSig : public pkgAcqMetaIndex
 {
    /** \brief The URI of the meta-index file for the detached signature */
-   string MetaIndexURI;
+   std::string MetaIndexURI;
 
    /** \brief A "URI-style" description of the meta-index file */
-   string MetaIndexURIDesc;
+   std::string MetaIndexURIDesc;
 
    /** \brief A brief description of the meta-index file */
-   string MetaIndexShortDesc;
+   std::string MetaIndexShortDesc;
 
    /** \brief The URI of the detached meta-signature file if the clearsigned one failed. */
-   string MetaSigURI;
+   std::string MetaSigURI;
 
    /** \brief A "URI-style" description of the meta-signature file */
-   string MetaSigURIDesc;
+   std::string MetaSigURIDesc;
 
    /** \brief A brief description of the meta-signature file */
-   string MetaSigShortDesc;
+   std::string MetaSigShortDesc;
 
 public:
-   void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
-   virtual string Custom600Headers();
+   void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual std::string Custom600Headers();
 
    /** \brief Create a new pkgAcqMetaClearSig. */
    pkgAcqMetaClearSig(pkgAcquire *Owner,
-		string const &URI, string const &URIDesc, string const &ShortDesc,
-		string const &MetaIndexURI, string const &MetaIndexURIDesc, string const &MetaIndexShortDesc,
-		string const &MetaSigURI, string const &MetaSigURIDesc, string const &MetaSigShortDesc,
-		const vector<struct IndexTarget*>* IndexTargets,
+		std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc,
+		std::string const &MetaIndexURI, std::string const &MetaIndexURIDesc, std::string const &MetaIndexShortDesc,
+		std::string const &MetaSigURI, std::string const &MetaSigURIDesc, std::string const &MetaSigShortDesc,
+		const std::vector<struct IndexTarget*>* IndexTargets,
 		indexRecords* MetaIndexParser);
 };
 									/*}}}*/
@@ -920,7 +920,7 @@ class pkgAcqArchive : public pkgAcquire::Item
    /** \brief A location in which the actual filename of the package
     *  should be stored.
     */
-   string &StoreFilename;
+   std::string &StoreFilename;
 
    /** \brief The next file for this version to try to download. */
    pkgCache::VerFileIterator Vf;
@@ -942,13 +942,13 @@ class pkgAcqArchive : public pkgAcquire::Item
    
    public:
    
-   virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
-   virtual void Done(string Message,unsigned long long Size,string Hash,
+   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual void Done(std::string Message,unsigned long long Size,std::string Hash,
 		     pkgAcquire::MethodConfig *Cnf);
-   virtual string DescURI() {return Desc.URI;};
-   virtual string ShortDesc() {return Desc.ShortDesc;};
+   virtual std::string DescURI() {return Desc.URI;};
+   virtual std::string ShortDesc() {return Desc.ShortDesc;};
    virtual void Finished();
-   virtual string HashSum() {return ExpectedHash.toStr(); };
+   virtual std::string HashSum() {return ExpectedHash.toStr(); };
    virtual bool IsTrusted();
    
    /** \brief Create a new pkgAcqArchive.
@@ -971,7 +971,7 @@ class pkgAcqArchive : public pkgAcquire::Item
     */
    pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
 		 pkgRecords *Recs,pkgCache::VerIterator const &Version,
-		 string &StoreFilename);
+		 std::string &StoreFilename);
 };
 									/*}}}*/
 /** \brief Retrieve an arbitrary file to the current directory.		{{{
@@ -999,12 +999,12 @@ class pkgAcqFile : public pkgAcquire::Item
    public:
    
    // Specialized action members
-   virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
-   virtual void Done(string Message,unsigned long long Size,string CalcHash,
+   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual void Done(std::string Message,unsigned long long Size,std::string CalcHash,
 		     pkgAcquire::MethodConfig *Cnf);
-   virtual string DescURI() {return Desc.URI;};
-   virtual string HashSum() {return ExpectedHash.toStr(); };
-   virtual string Custom600Headers();
+   virtual std::string DescURI() {return Desc.URI;};
+   virtual std::string HashSum() {return ExpectedHash.toStr(); };
+   virtual std::string Custom600Headers();
 
    /** \brief Create a new pkgAcqFile object.
     *
@@ -1037,9 +1037,9 @@ class pkgAcqFile : public pkgAcquire::Item
     * is the absolute name to which the file should be downloaded.
     */
 
-   pkgAcqFile(pkgAcquire *Owner, string URI, string Hash, unsigned long long Size,
-	      string Desc, string ShortDesc,
-	      const string &DestDir="", const string &DestFilename="",
+   pkgAcqFile(pkgAcquire *Owner, std::string URI, std::string Hash, unsigned long long Size,
+	      std::string Desc, std::string ShortDesc,
+	      const std::string &DestDir="", const std::string &DestFilename="",
 	      bool IsIndexFile=false);
 };
 									/*}}}*/

+ 3 - 3
apt-pkg/acquire-method.h

@@ -20,11 +20,11 @@
 #ifndef PKGLIB_ACQUIRE_METHOD_H
 #define PKGLIB_ACQUIRE_METHOD_H
 
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/strutl.h>
-
 #include <stdarg.h>
 
+#include <string>
+#include <vector>
+
 class Hashes;
 class pkgAcqMethod
 {

+ 3 - 0
apt-pkg/algorithms.cc

@@ -23,6 +23,9 @@
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/edsp.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/progress.h>
 
 #include <sys/types.h>
 #include <cstdlib>

+ 2 - 1
apt-pkg/algorithms.h

@@ -33,10 +33,11 @@
 
 #include <apt-pkg/packagemanager.h>
 #include <apt-pkg/depcache.h>
-#include <apt-pkg/acquire.h>
 
 #include <iostream>
 
+class pkgAcquireStatus;
+
 class pkgSimulate : public pkgPackageManager				/*{{{*/
 {
    protected:

+ 1 - 0
apt-pkg/cachefile.cc

@@ -23,6 +23,7 @@
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/progress.h>
 
 #include <apti18n.h>
 									/*}}}*/

+ 5 - 4
apt-pkg/cachefile.h

@@ -17,11 +17,12 @@
 #ifndef PKGLIB_CACHEFILE_H
 #define PKGLIB_CACHEFILE_H
 
-
 #include <apt-pkg/depcache.h>
-#include <apt-pkg/acquire.h>
-#include <apt-pkg/policy.h>
-#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/macros.h>
+
+class pkgPolicy;
+class pkgSourceList;
+class OpProgress;
 
 class pkgCacheFile
 {

+ 1 - 0
apt-pkg/cacheiterators.h

@@ -32,6 +32,7 @@
 #include<iterator>
 
 #include<string.h>
+
 // abstract Iterator template						/*{{{*/
 /* This template provides the very basic iterator methods we
    need to have for doing some walk-over-the-cache magic */

+ 5 - 2
apt-pkg/cacheset.cc

@@ -12,11 +12,14 @@
 #include <config.h>
 
 #include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/cachefile.h>
 #include <apt-pkg/cachefilter.h>
 #include <apt-pkg/cacheset.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/versionmatch.h>
+#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/policy.h>
 
 #include <vector>
 
@@ -298,7 +301,7 @@ APT::VersionSet VersionSet::FromString(pkgCacheFile &Cache, std::string pkg,
 	std::string ver;
 	bool verIsRel = false;
 	size_t const vertag = pkg.find_last_of("/=");
-	if (vertag != string::npos) {
+	if (vertag != std::string::npos) {
 		ver = pkg.substr(vertag+1);
 		verIsRel = (pkg[vertag] == '/');
 		pkg.erase(vertag);
@@ -316,7 +319,7 @@ APT::VersionSet VersionSet::FromString(pkgCacheFile &Cache, std::string pkg,
 		errors = helper.showErrors(false);
 	for (PackageSet::const_iterator P = pkgset.begin();
 	     P != pkgset.end(); ++P) {
-		if (vertag == string::npos) {
+		if (vertag == std::string::npos) {
 			verset.insert(VersionSet::FromPackage(Cache, P, fallback, helper));
 			continue;
 		}

+ 8 - 5
apt-pkg/cacheset.h

@@ -16,9 +16,12 @@
 #include <set>
 #include <string>
 
-#include <apt-pkg/cachefile.h>
+#include <apt-pkg/error.h>
 #include <apt-pkg/pkgcache.h>
 									/*}}}*/
+
+class pkgCacheFile;
+
 namespace APT {
 class PackageSet;
 class VersionSet;
@@ -37,10 +40,10 @@ public:									/*{{{*/
 			ShowError(ShowError), ErrorType(ErrorType) {};
 	virtual ~CacheSetHelper() {};
 
-	virtual void showTaskSelection(PackageSet const &pkgset, string const &pattern) {};
-	virtual void showRegExSelection(PackageSet const &pkgset, string const &pattern) {};
+	virtual void showTaskSelection(PackageSet const &pkgset, std::string const &pattern) {};
+	virtual void showRegExSelection(PackageSet const &pkgset, std::string const &pattern) {};
 	virtual void showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver,
-				 string const &ver, bool const &verIsRel) {};
+				 std::string const &ver, bool const &verIsRel) {};
 
 	virtual pkgCache::PkgIterator canNotFindPkgName(pkgCacheFile &Cache, std::string const &str);
 	virtual PackageSet canNotFindTask(pkgCacheFile &Cache, std::string pattern);
@@ -265,7 +268,7 @@ public:									/*{{{*/
 		inline pkgCache::VerFileIterator FileList() const { return (**this).FileList(); };
 		inline bool Downloadable() const { return (**this).Downloadable(); };
 		inline const char *PriorityType() const { return (**this).PriorityType(); };
-		inline string RelStr() const { return (**this).RelStr(); };
+		inline std::string RelStr() const { return (**this).RelStr(); };
 		inline bool Automatic() const { return (**this).Automatic(); };
 		inline pkgCache::VerFileIterator NewestFile() const { return (**this).NewestFile(); };
 	};

+ 2 - 0
apt-pkg/cdrom.cc

@@ -8,6 +8,8 @@
 #include<apt-pkg/strutl.h>
 #include<apt-pkg/cdrom.h>
 #include<apt-pkg/aptconfiguration.h>
+#include<apt-pkg/configuration.h>
+#include<apt-pkg/fileutl.h>
 
 #include<sstream>
 #include<fstream>

+ 2 - 1
apt-pkg/cdrom.h

@@ -1,10 +1,11 @@
 #ifndef PKGLIB_CDROM_H
 #define PKGLIB_CDROM_H
 
-#include<apt-pkg/init.h>
 #include<string>
 #include<vector>
 
+class Configuration;
+class OpProgress;
 
 class pkgCdromStatus							/*{{{*/
 {

+ 1 - 0
apt-pkg/clean.cc

@@ -15,6 +15,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/fileutl.h>
 
 #include <dirent.h>
 #include <sys/stat.h>

+ 1 - 0
apt-pkg/contrib/cmndline.cc

@@ -13,6 +13,7 @@
 // Include files							/*{{{*/
 #include<config.h>
 
+#include <apt-pkg/configuration.h>
 #include <apt-pkg/cmndline.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>

+ 1 - 3
apt-pkg/contrib/cmndline.h

@@ -44,9 +44,7 @@
 #ifndef PKGLIB_CMNDLINE_H
 #define PKGLIB_CMNDLINE_H
 
-
-
-#include <apt-pkg/configuration.h>
+class Configuration;
 
 class CommandLine
 {

+ 1 - 0
apt-pkg/contrib/mmap.cc

@@ -21,6 +21,7 @@
 
 #include <apt-pkg/mmap.h>
 #include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
 
 #include <sys/mman.h>
 #include <sys/stat.h>

+ 2 - 1
apt-pkg/contrib/mmap.h

@@ -27,7 +27,8 @@
 
 
 #include <string>
-#include <apt-pkg/fileutl.h>
+
+class FileFd;
 
 /* This should be a 32 bit type, larger tyes use too much ram and smaller
    types are too small. Where ever possible 'unsigned long' should be used

+ 2 - 0
apt-pkg/contrib/netrc.cc

@@ -14,7 +14,9 @@
 #include <config.h>
 
 #include <apt-pkg/configuration.h>
+#include <apt-pkg/strutl.h>
 #include <apt-pkg/fileutl.h>
+
 #include <iostream>
 #include <stdio.h>
 #include <stdlib.h>

+ 3 - 1
apt-pkg/contrib/netrc.h

@@ -14,11 +14,13 @@
 #ifndef NETRC_H
 #define NETRC_H
 
-#include <apt-pkg/strutl.h>
+#include <string>
 
 #define DOT_CHAR "."
 #define DIR_CHAR "/"
 
+class URI;
+
 // Assume: password[0]=0, host[0] != 0.
 // If login[0] = 0, search for login and password within a machine section
 // in the netrc.

+ 1 - 0
apt-pkg/deb/deblistparser.cc

@@ -17,6 +17,7 @@
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
 #include <apt-pkg/crc-16.h>
 #include <apt-pkg/md5.h>
 #include <apt-pkg/macros.h>

+ 0 - 1
apt-pkg/deb/deblistparser.h

@@ -12,7 +12,6 @@
 #define PKGLIB_DEBLISTPARSER_H
 
 #include <apt-pkg/pkgcachegen.h>
-#include <apt-pkg/indexfile.h>
 #include <apt-pkg/tagfile.h>
 
 class debListParser : public pkgCacheGenerator::ListParser

+ 3 - 0
apt-pkg/deb/debmetaindex.cc

@@ -4,9 +4,12 @@
 #include <apt-pkg/debmetaindex.h>
 #include <apt-pkg/debindexfile.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/indexrecords.h>
+#include <apt-pkg/sourcelist.h>
 #include <apt-pkg/error.h>
 
 #include <set>

+ 22 - 21
apt-pkg/deb/debmetaindex.h

@@ -3,9 +3,10 @@
 #define PKGLIB_DEBMETAINDEX_H
 
 #include <apt-pkg/metaindex.h>
-#include <apt-pkg/sourcelist.h>
 
 #include <map>
+#include <string>
+#include <vector>
 
 class debReleaseIndex : public metaIndex {
    public:
@@ -13,43 +14,43 @@ class debReleaseIndex : public metaIndex {
    class debSectionEntry
    {
       public:
-      debSectionEntry (string const &Section, bool const &IsSrc);
-      string const Section;
+      debSectionEntry (std::string const &Section, bool const &IsSrc);
+      std::string const Section;
       bool const IsSrc;
    };
 
    private:
    /** \brief dpointer placeholder (for later in case we need it) */
    void *d;
-   std::map<string, vector<debSectionEntry const*> > ArchEntries;
+   std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
    enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
 
    public:
 
-   debReleaseIndex(string const &URI, string const &Dist);
-   debReleaseIndex(string const &URI, string const &Dist, bool const Trusted);
+   debReleaseIndex(std::string const &URI, std::string const &Dist);
+   debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted);
    virtual ~debReleaseIndex();
 
-   virtual string ArchiveURI(string const &File) const {return URI + File;};
+   virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
    virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
-   vector <struct IndexTarget *>* ComputeIndexTargets() const;
-   string Info(const char *Type, string const &Section, string const &Arch="") const;
-   string MetaIndexInfo(const char *Type) const;
-   string MetaIndexFile(const char *Types) const;
-   string MetaIndexURI(const char *Type) const;
-   string IndexURI(const char *Type, string const &Section, string const &Arch="native") const;
-   string IndexURISuffix(const char *Type, string const &Section, string const &Arch="native") const;
-   string SourceIndexURI(const char *Type, const string &Section) const;
-   string SourceIndexURISuffix(const char *Type, const string &Section) const;
-   string TranslationIndexURI(const char *Type, const string &Section) const;
-   string TranslationIndexURISuffix(const char *Type, const string &Section) const;
-   virtual vector <pkgIndexFile *> *GetIndexFiles();
+   std::vector <struct IndexTarget *>* ComputeIndexTargets() const;
+   std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const;
+   std::string MetaIndexInfo(const char *Type) const;
+   std::string MetaIndexFile(const char *Types) const;
+   std::string MetaIndexURI(const char *Type) const;
+   std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const;
+   std::string IndexURISuffix(const char *Type, std::string const &Section, std::string const &Arch="native") const;
+   std::string SourceIndexURI(const char *Type, const std::string &Section) const;
+   std::string SourceIndexURISuffix(const char *Type, const std::string &Section) const;
+   std::string TranslationIndexURI(const char *Type, const std::string &Section) const;
+   std::string TranslationIndexURISuffix(const char *Type, const std::string &Section) const;
+   virtual std::vector <pkgIndexFile *> *GetIndexFiles();
 
    void SetTrusted(bool const Trusted);
    virtual bool IsTrusted() const;
 
-   void PushSectionEntry(vector<string> const &Archs, const debSectionEntry *Entry);
-   void PushSectionEntry(string const &Arch, const debSectionEntry *Entry);
+   void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry);
+   void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry);
    void PushSectionEntry(const debSectionEntry *Entry);
 };
 

+ 2 - 0
apt-pkg/deb/debrecords.cc

@@ -14,6 +14,8 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/fileutl.h>
+
 #include <langinfo.h>
 									/*}}}*/
 

+ 1 - 1
apt-pkg/deb/debrecords.h

@@ -15,8 +15,8 @@
 #define PKGLIB_DEBRECORDS_H
 
 #include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/indexfile.h>
 #include <apt-pkg/tagfile.h>
+#include <apt-pkg/fileutl.h>
 
 class debRecordParser : public pkgRecords::Parser
 {

+ 3 - 1
apt-pkg/deb/debsystem.h

@@ -11,10 +11,12 @@
 #define PKGLIB_DEBSYSTEM_H
 
 #include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/pkgcache.h>
 
 class debSystemPrivate;
-
 class debStatusIndex;
+class pkgDepCache;
+
 class debSystem : public pkgSystem
 {
    // private d-pointer

+ 1 - 1
apt-pkg/depcache.cc

@@ -16,13 +16,13 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/algorithms.h>
-
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/tagfile.h>
+#include <apt-pkg/progress.h>
 
 #include <iostream>
 #include <sstream>

+ 3 - 2
apt-pkg/depcache.h

@@ -40,12 +40,13 @@
 
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/pkgcache.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/error.h>
 
 #include <vector>
 #include <memory>
 #include <set>
+#include <list>
+
+class OpProgress;
 
 class pkgDepCache : protected pkgCache::Namespace
 {

+ 7 - 0
apt-pkg/edsp.cc

@@ -9,17 +9,24 @@
 
 #include <apt-pkg/edsp.h>
 #include <apt-pkg/error.h>
+#include <apt-pkg/cacheset.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/version.h>
 #include <apt-pkg/policy.h>
 #include <apt-pkg/tagfile.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/progress.h>
 
 #include <limits>
 #include <stdio.h>
 
+#include <string>
+
 #include <apti18n.h>
 									/*}}}*/
 
+using std::string;
+
 // we could use pkgCache::DepType and ::Priority, but these would be localized strings…
 const char * const EDSP::PrioMap[] = {0, "important", "required", "standard",
 				      "optional", "extra"};

+ 8 - 3
apt-pkg/edsp.h

@@ -9,12 +9,17 @@
 #ifndef PKGLIB_EDSP_H
 #define PKGLIB_EDSP_H
 
-#include <apt-pkg/depcache.h>
-#include <apt-pkg/cacheset.h>
-#include <apt-pkg/progress.h>
+#include <apt-pkg/pkgcache.h>
 
+#include <list>
 #include <string>
 
+namespace APT {
+	class PackageSet;
+};
+class pkgDepCache;
+class OpProgress;
+
 class EDSP								/*{{{*/
 {
 	// we could use pkgCache::DepType and ::Priority, but these would be localized strings…

+ 1 - 0
apt-pkg/edsp/edspindexfile.cc

@@ -15,6 +15,7 @@
 #include <apt-pkg/progress.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
 #include <apt-pkg/acquire-item.h>
 
 #include <sys/stat.h>

+ 0 - 1
apt-pkg/edsp/edspindexfile.h

@@ -8,7 +8,6 @@
 #ifndef PKGLIB_EDSPINDEXFILE_H
 #define PKGLIB_EDSPINDEXFILE_H
 
-#include <apt-pkg/indexfile.h>
 #include <apt-pkg/debindexfile.h>
 
 class edspIndex : public debStatusIndex

+ 2 - 3
apt-pkg/edsp/edsplistparser.h

@@ -12,9 +12,8 @@
 #define PKGLIB_EDSPLISTPARSER_H
 
 #include <apt-pkg/deblistparser.h>
-#include <apt-pkg/pkgcachegen.h>
-#include <apt-pkg/indexfile.h>
-#include <apt-pkg/tagfile.h>
+
+class FileFd;
 
 class edspListParser : public debListParser
 {

+ 2 - 0
apt-pkg/indexfile.h

@@ -27,10 +27,12 @@
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/macros.h>
 
 class pkgAcquire;
 class pkgCacheGenerator;
 class OpProgress;
+
 class pkgIndexFile
 {
    protected:

+ 3 - 0
apt-pkg/indexrecords.cc

@@ -10,6 +10,9 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/configuration.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/hashes.h>
+
 #include <sys/stat.h>
 #include <clocale>
 

+ 0 - 1
apt-pkg/indexrecords.h

@@ -7,7 +7,6 @@
 
 
 #include <apt-pkg/pkgcache.h>
-#include <apt-pkg/fileutl.h>
 #include <apt-pkg/hashes.h>
 
 #include <map>

+ 2 - 0
apt-pkg/init.cc

@@ -13,6 +13,8 @@
 #include <apt-pkg/init.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/error.h>
+#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/configuration.h>
 
 #include <cstdlib>
 #include <sys/stat.h>

+ 2 - 2
apt-pkg/init.h

@@ -13,8 +13,8 @@
 #ifndef PKGLIB_INIT_H
 #define PKGLIB_INIT_H
 
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/pkgsystem.h>
+class pkgSystem;
+class Configuration;
 
 // These lines are extracted by the makefiles and the buildsystem
 // Increasing MAJOR or MINOR results in the need of recompiling all

+ 0 - 3
apt-pkg/metaindex.h

@@ -4,10 +4,7 @@
 
 #include <string>
 #include <apt-pkg/pkgcache.h>
-#include <apt-pkg/srcrecords.h>
-#include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/indexfile.h>
-#include <apt-pkg/vendor.h>
 
 class pkgAcquire;
 class pkgCacheGenerator;

+ 1 - 2
apt-pkg/packagemanager.h

@@ -23,11 +23,10 @@
 #ifndef PKGLIB_PACKAGEMANAGER_H
 #define PKGLIB_PACKAGEMANAGER_H
 
+#include <apt-pkg/pkgcache.h>
 
 #include <string>
 #include <iostream>
-#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/depcache.h>
 #include <set>
 
 class pkgAcquire;

+ 2 - 0
apt-pkg/pkgcachegen.cc

@@ -25,6 +25,8 @@
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/macros.h>
 #include <apt-pkg/tagfile.h>
+#include <apt-pkg/metaindex.h>
+#include <apt-pkg/fileutl.h>
 
 #include <vector>
 #include <sys/stat.h>

+ 4 - 2
apt-pkg/pkgsystem.h

@@ -37,14 +37,16 @@
 #ifndef PKGLIB_PKGSYSTEM_H
 #define PKGLIB_PKGSYSTEM_H
 
+#include <apt-pkg/pkgcache.h>
 
-#include <apt-pkg/depcache.h>
 #include <vector>
-    
+
+class pkgDepCache;
 class pkgPackageManager;
 class pkgVersioningSystem;
 class Configuration;
 class pkgIndexFile;
+class PkgFileIterator;
 
 class pkgSystem
 {   

+ 2 - 0
apt-pkg/sourcelist.cc

@@ -15,6 +15,8 @@
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/configuration.h>
+#include <apt-pkg/metaindex.h>
+#include <apt-pkg/indexfile.h>
 
 #include <fstream>
 

+ 4 - 2
apt-pkg/sourcelist.h

@@ -31,13 +31,15 @@
 #include <vector>
 #include <map>
 #include <apt-pkg/pkgcache.h>
-#include <apt-pkg/metaindex.h>
 
 using std::string;
 using std::vector;
     
 
-class pkgAquire;
+class pkgAcquire;
+class pkgIndexFile;
+class metaIndex;
+
 class pkgSourceList
 {
    public:

+ 1 - 0
apt-pkg/srcrecords.cc

@@ -17,6 +17,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/metaindex.h>
 
 #include <apti18n.h>
 									/*}}}*/

+ 1 - 0
apt-pkg/tagfile.cc

@@ -16,6 +16,7 @@
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
 
 #include <string>
 #include <stdio.h>

+ 4 - 2
apt-pkg/tagfile.h

@@ -20,10 +20,12 @@
 #ifndef PKGLIB_TAGFILE_H
 #define PKGLIB_TAGFILE_H
 
-
-#include <apt-pkg/fileutl.h>
 #include <stdio.h>
 
+#include <string>
+
+class FileFd;
+
 class pkgTagSection
 {
    const char *Section;

+ 2 - 0
apt-pkg/vendorlist.cc

@@ -2,12 +2,14 @@
 
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/error.h>
+#include <apt-pkg/configuration.h>
 #include <apti18n.h>
 
 #if __GNUC__ >= 4
 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
 
+#include <apt-pkg/vendor.h>
 #include <apt-pkg/vendorlist.h>
 
 using std::string;

+ 3 - 2
apt-pkg/vendorlist.h

@@ -15,10 +15,11 @@
 
 #include <string>
 #include <vector>
-#include <apt-pkg/vendor.h>
-#include <apt-pkg/configuration.h>
 #include <apt-pkg/macros.h>
 
+class Vendor;
+class Configuration;
+
 class __deprecated pkgVendorList
 {
    protected:

+ 1 - 2
apt-pkg/version.h

@@ -20,8 +20,7 @@
 #ifndef PKGLIB_VERSION_H
 #define PKGLIB_VERSION_H
 
-
-#include <apt-pkg/strutl.h>    
+#include <apt-pkg/strutl.h>
 #include <string>
 
 class pkgVersioningSystem

+ 3 - 1
cmdline/acqprogress.h

@@ -12,6 +12,8 @@
 
 #include <apt-pkg/acquire.h>
 
+#include <string>
+
 class AcqTextStatus : public pkgAcquireStatus
 {
    unsigned int &ScreenWidth;
@@ -21,7 +23,7 @@ class AcqTextStatus : public pkgAcquireStatus
    
    public:
    
-   virtual bool MediaChange(string Media,string Drive);
+   virtual bool MediaChange(std::string Media,std::string Drive);
    virtual void IMSHit(pkgAcquire::ItemDesc &Itm);
    virtual void Fetch(pkgAcquire::ItemDesc &Itm);
    virtual void Done(pkgAcquire::ItemDesc &Itm);

+ 5 - 1
cmdline/apt-cache.cc

@@ -16,7 +16,6 @@
 #include<config.h>
 
 #include <apt-pkg/error.h>
-#include <apt-pkg/pkgcachegen.h>
 #include <apt-pkg/cachefile.h>
 #include <apt-pkg/cacheset.h>
 #include <apt-pkg/init.h>
@@ -24,6 +23,7 @@
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/cmndline.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/version.h>
@@ -31,6 +31,9 @@
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/algorithms.h>
 #include <apt-pkg/sptr.h>
+#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/metaindex.h>
 
 #include <cassert>
 #include <locale.h>
@@ -40,6 +43,7 @@
 #include <regex.h>
 #include <stdio.h>
 #include <iomanip>
+#include <algorithm>
 
 #include <apti18n.h>
 									/*}}}*/

+ 2 - 0
cmdline/apt-cdrom.cc

@@ -23,6 +23,8 @@
 #include <apt-pkg/acquire.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/cdrom.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/pkgsystem.h>
 
 #include <locale.h>
 #include <iostream>

+ 1 - 0
cmdline/apt-config.cc

@@ -24,6 +24,7 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/pkgsystem.h>
 
 #include <locale.h>
 #include <iostream>

+ 1 - 0
cmdline/apt-dump-solver.cc

@@ -12,6 +12,7 @@
 #include <config.h>
 
 #include <cstdio>
+#include <iostream>
 									/*}}}*/
 
 // ShowHelp - Show a help screen					/*{{{*/

+ 1 - 0
cmdline/apt-extracttemplates.cc

@@ -30,6 +30,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgsystem.h>
 
 #include <stdio.h>
 #include <string.h>

+ 5 - 0
cmdline/apt-get.cc

@@ -36,6 +36,7 @@
 #include <apt-pkg/algorithms.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
 #include <apt-pkg/clean.h>
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/version.h>
@@ -44,6 +45,10 @@
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/md5.h>
 #include <apt-pkg/versionmatch.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/indexfile.h>
 
 #include "acqprogress.h"
 

+ 2 - 0
cmdline/apt-internal-solver.cc

@@ -11,10 +11,12 @@
 #include <apt-pkg/cmndline.h>
 #include <apt-pkg/init.h>
 #include <apt-pkg/cachefile.h>
+#include <apt-pkg/cacheset.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/edsp.h>
 #include <apt-pkg/algorithms.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgsystem.h>
 
 #include <config.h>
 #include <apti18n.h>

+ 1 - 0
cmdline/apt-mark.cc

@@ -13,6 +13,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/init.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/pkgsystem.h>
 
 #include <algorithm>
 

+ 2 - 0
cmdline/apt-sortpkgs.cc

@@ -20,6 +20,8 @@
 #include <apt-pkg/cmndline.h>
 #include <apt-pkg/init.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgsystem.h>
 
 #include <vector>
 #include <algorithm>

+ 2 - 1
debian/changelog

@@ -2,8 +2,9 @@ apt (0.8.16~exp7) experimental; urgency=low
 
   [ David Kalnischkies ]
   * do not pollute namespace in the headers with using (Closes: #500198)
+  * use forward declaration in headers if possible instead of includes
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Mon, 19 Sep 2011 13:25:58 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Mon, 19 Sep 2011 19:13:48 +0200
 
 apt (0.8.16~exp6) experimental; urgency=low
 

+ 1 - 0
ftparchive/cachedb.cc

@@ -18,6 +18,7 @@
 #include <apt-pkg/sha2.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/configuration.h>
+#include <apt-pkg/fileutl.h>
     
 #include <netinet/in.h>       // htonl, etc
 

+ 4 - 4
ftparchive/cachedb.h

@@ -13,16 +13,16 @@
 #define CACHEDB_H
 
 
+#include <apt-pkg/debfile.h>
 
 #include <db.h>
-#include <string>
-#include <apt-pkg/debfile.h>
 #include <inttypes.h>
 #include <sys/stat.h>
 #include <errno.h>
-    
+#include <string>
+
 #include "contents.h"
-    
+
 class CacheDB
 {
    protected:

+ 2 - 1
ftparchive/contents.h

@@ -12,9 +12,10 @@
     
 #include <stdlib.h>
 #include <stdio.h>
-#include <apt-pkg/debfile.h>
 #include <apt-pkg/dirstream.h>
 
+class debDebFile;
+
 class GenContents
 {
    struct Node

+ 2 - 3
ftparchive/multicompress.h

@@ -16,11 +16,10 @@
 #ifndef MULTICOMPRESS_H
 #define MULTICOMPRESS_H
 
-
-
-#include <string>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/aptconfiguration.h>
+
+#include <string>
 #include <stdio.h>
 #include <sys/types.h>
     

+ 3 - 2
ftparchive/writer.h

@@ -22,7 +22,6 @@
 #include <set>
 
 #include "cachedb.h"
-#include "multicompress.h"
 #include "override.h"
 #include "apt-ftparchive.h"
 
@@ -31,7 +30,7 @@ using std::cout;
 using std::endl;
 using std::vector;
 using std::map;
-    
+
 class FTWScanner
 {
    protected:
@@ -81,6 +80,8 @@ class FTWScanner
    virtual ~FTWScanner() {};
 };
 
+class MultiCompress;
+
 class TranslationWriter
 {
    MultiCompress *Comp;

+ 1 - 0
methods/bzip2.cc

@@ -20,6 +20,7 @@
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/hashes.h>
+#include <apt-pkg/configuration.h>
 
 #include <sys/stat.h>
 #include <unistd.h>

+ 1 - 0
methods/cdrom.cc

@@ -16,6 +16,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
 #include <apt-pkg/hashes.h>
 
 #include <sys/stat.h>

+ 2 - 0
methods/connect.cc

@@ -15,6 +15,8 @@
 
 #include <apt-pkg/error.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/acquire-method.h>
 
 #include <stdio.h>
 #include <errno.h>

+ 2 - 1
methods/connect.h

@@ -11,7 +11,8 @@
 #define CONNECT_H
 
 #include <string>
-#include <apt-pkg/acquire-method.h>
+
+class pkgAcqMethod;
 
 bool Connect(std::string To,int Port,const char *Service,int DefPort,
 	     int &Fd,unsigned long TimeOut,pkgAcqMethod *Owner);

+ 1 - 0
methods/copy.cc

@@ -12,6 +12,7 @@
 #include <config.h>
 
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/hashes.h>

+ 1 - 0
methods/file.cc

@@ -19,6 +19,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/strutl.h>
 
 #include <sys/stat.h>
 #include <unistd.h>

+ 1 - 0
methods/ftp.cc

@@ -22,6 +22,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/netrc.h>
+#include <apt-pkg/configuration.h>
 
 #include <sys/stat.h>
 #include <sys/time.h>

+ 4 - 0
methods/ftp.h

@@ -10,6 +10,10 @@
 #ifndef APT_FTP_H
 #define APT_FTP_H
 
+#include <apt-pkg/strutl.h>
+
+#include <string>
+
 class FTPConn
 {
    char Buffer[1024*10];

+ 1 - 0
methods/gpgv.cc

@@ -5,6 +5,7 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/indexcopy.h>
+#include <apt-pkg/configuration.h>
 
 #include <utime.h>
 #include <stdio.h>

+ 6 - 0
methods/http.cc

@@ -29,6 +29,7 @@
 
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/acquire-method.h>
+#include <apt-pkg/configuration.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/netrc.h>
@@ -288,6 +289,11 @@ void CircleBuf::Stats()
    clog << "Got " << InP << " in " << Diff << " at " << InP/Diff << endl;*/
 }
 									/*}}}*/
+CircleBuf::~CircleBuf()
+{
+   delete [] Buf;
+   delete Hash;
+}
 
 // ServerState::ServerState - Constructor				/*{{{*/
 // ---------------------------------------------------------------------

+ 5 - 2
methods/http.h

@@ -13,12 +13,15 @@
 
 #define MAXLEN 360
 
-#include <apt-pkg/hashes.h>
+#include <apt-pkg/strutl.h>
+
+#include <string>
 
 using std::cout;
 using std::endl;
 
 class HttpMethod;
+class Hashes;
 
 class CircleBuf
 {
@@ -80,7 +83,7 @@ class CircleBuf
    void Stats();
 
    CircleBuf(unsigned long long Size);
-   ~CircleBuf() {delete [] Buf; delete Hash;};
+   ~CircleBuf();
 };
 
 struct ServerState

+ 1 - 0
methods/https.cc

@@ -17,6 +17,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/netrc.h>
+#include <apt-pkg/configuration.h>
 
 #include <sys/stat.h>
 #include <sys/time.h>

+ 2 - 1
methods/https.h

@@ -20,7 +20,7 @@ using std::cout;
 using std::endl;
 
 class HttpsMethod;
-
+class FileFd;
 
 class HttpsMethod : public pkgAcqMethod
 {
@@ -45,6 +45,7 @@ class HttpsMethod : public pkgAcqMethod
    };
 };
 
+#include <apt-pkg/strutl.h>
 URI Proxy;
 
 #endif

+ 2 - 1
methods/mirror.cc

@@ -18,7 +18,8 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/sourcelist.h>
-
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/metaindex.h>
 
 #include <algorithm>
 #include <fstream>

+ 13 - 12
methods/mirror.h

@@ -11,8 +11,9 @@
 #ifndef APT_MIRROR_H
 #define APT_MIRROR_H
 
-
 #include <iostream>
+#include <string>
+#include <vector>
 
 using std::cout;
 using std::cerr;
@@ -24,29 +25,29 @@ class MirrorMethod : public HttpMethod
 {
    FetchResult Res;
    // we simply transform between BaseUri and Mirror
-   string BaseUri;    // the original mirror://... url
-   string Mirror;     // the selected mirror uri (http://...)
-   vector<string> AllMirrors; // all available mirrors
-   string MirrorFile; // the file that contains the list of mirrors
+   std::string BaseUri;    // the original mirror://... url
+   std::string Mirror;     // the selected mirror uri (http://...)
+   std::vector<std::string> AllMirrors; // all available mirrors
+   std::string MirrorFile; // the file that contains the list of mirrors
    bool DownloadedMirrorFile; // already downloaded this session
-   string Dist;       // the target distrubtion (e.g. sid, oneiric)
+   std::string Dist;       // the target distrubtion (e.g. sid, oneiric)
 
    bool Debug;
 
  protected:
-   bool DownloadMirrorFile(string uri);
-   bool RandomizeMirrorFile(string file);
-   string GetMirrorFileName(string uri);
+   bool DownloadMirrorFile(std::string uri);
+   bool RandomizeMirrorFile(std::string file);
+   std::string GetMirrorFileName(std::string uri);
    bool InitMirrors();
    bool TryNextMirror();
    void CurrentQueueUriToMirror();
-   bool Clean(string dir);
+   bool Clean(std::string dir);
    
    // we need to overwrite those to transform the url back
-   virtual void Fail(string Why, bool Transient = false);
+   virtual void Fail(std::string Why, bool Transient = false);
    virtual void URIStart(FetchResult &Res);
    virtual void URIDone(FetchResult &Res,FetchResult *Alt = 0);
-   virtual bool Configuration(string Message);
+   virtual bool Configuration(std::string Message);
 
  public:
    MirrorMethod();

+ 1 - 0
methods/rred.cc

@@ -7,6 +7,7 @@
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/hashes.h>
+#include <apt-pkg/configuration.h>
 
 #include <sys/stat.h>
 #include <sys/uio.h>

+ 3 - 0
methods/rsh.cc

@@ -14,6 +14,9 @@
 #include <config.h>
 
 #include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/hashes.h>
+#include <apt-pkg/configuration.h>
 
 #include <sys/stat.h>
 #include <sys/time.h>

+ 5 - 3
methods/rsh.h

@@ -12,9 +12,9 @@
 
 #include <string>
 #include <apt-pkg/strutl.h>
-#include <apt-pkg/hashes.h>
-#include <apt-pkg/acquire-method.h>
-#include <apt-pkg/fileutl.h>
+
+class Hashes;
+class FileFd;
 
 class RSHConn
 {
@@ -50,6 +50,8 @@ class RSHConn
    ~RSHConn();
 };
 
+#include <apt-pkg/acquire-method.h>
+
 class RSHMethod : public pkgAcqMethod
 {
    virtual bool Fetch(FetchItem *Itm);

+ 1 - 0
test/interactive-helper/extract-control.cc

@@ -1,5 +1,6 @@
 #include <apt-pkg/debfile.h>
 #include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
 
 #include <iostream>
 #include <unistd.h>

+ 1 - 0
test/interactive-helper/test_udevcdrom.cc

@@ -3,6 +3,7 @@
 #include <assert.h>
 
 #include <vector>
+#include <iostream>
 
 int main()
 {

+ 2 - 0
test/interactive-helper/testextract.cc

@@ -6,6 +6,8 @@
 #include <apt-pkg/extract.h>
 #include <apt-pkg/init.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgsystem.h>
 
 #include <stdio.h>
 #include <stdlib.h>