summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-09-19 19:14:19 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-09-19 19:14:19 +0200
commit472ff00ef2e48383805d281c6364ec27839e3f4d (patch)
tree6f81e83690167fc78f3bbd3dcf03cf83cdcc60f6
parent8f3ba4e8708cb72be19dacc2af4f601ee5fea292 (diff)
downloadapt-472ff00ef2e48383805d281c6364ec27839e3f4d.tar.gz
use forward declaration in headers if possible instead of includes
-rw-r--r--apt-inst/contrib/arfile.cc1
-rw-r--r--apt-inst/contrib/arfile.h3
-rw-r--r--apt-inst/contrib/extracttar.cc1
-rw-r--r--apt-inst/contrib/extracttar.h5
-rw-r--r--apt-inst/database.cc7
-rw-r--r--apt-inst/database.h8
-rw-r--r--apt-inst/deb/debfile.cc1
-rw-r--r--apt-inst/deb/debfile.h5
-rw-r--r--apt-inst/deb/dpkgdb.cc2
-rw-r--r--apt-inst/deb/dpkgdb.h5
-rw-r--r--apt-inst/extract.cc1
-rw-r--r--apt-inst/filelist.h3
-rw-r--r--apt-pkg/acquire-item.cc2
-rw-r--r--apt-pkg/acquire-item.h238
-rw-r--r--apt-pkg/acquire-method.h6
-rw-r--r--apt-pkg/algorithms.cc3
-rw-r--r--apt-pkg/algorithms.h3
-rw-r--r--apt-pkg/cachefile.cc1
-rw-r--r--apt-pkg/cachefile.h9
-rw-r--r--apt-pkg/cacheiterators.h1
-rw-r--r--apt-pkg/cacheset.cc7
-rw-r--r--apt-pkg/cacheset.h13
-rw-r--r--apt-pkg/cdrom.cc2
-rw-r--r--apt-pkg/cdrom.h3
-rw-r--r--apt-pkg/clean.cc1
-rw-r--r--apt-pkg/contrib/cmndline.cc1
-rw-r--r--apt-pkg/contrib/cmndline.h4
-rw-r--r--apt-pkg/contrib/mmap.cc1
-rw-r--r--apt-pkg/contrib/mmap.h3
-rw-r--r--apt-pkg/contrib/netrc.cc2
-rw-r--r--apt-pkg/contrib/netrc.h4
-rw-r--r--apt-pkg/deb/deblistparser.cc1
-rw-r--r--apt-pkg/deb/deblistparser.h1
-rw-r--r--apt-pkg/deb/debmetaindex.cc3
-rw-r--r--apt-pkg/deb/debmetaindex.h43
-rw-r--r--apt-pkg/deb/debrecords.cc2
-rw-r--r--apt-pkg/deb/debrecords.h2
-rw-r--r--apt-pkg/deb/debsystem.h4
-rw-r--r--apt-pkg/depcache.cc2
-rw-r--r--apt-pkg/depcache.h5
-rw-r--r--apt-pkg/edsp.cc7
-rw-r--r--apt-pkg/edsp.h11
-rw-r--r--apt-pkg/edsp/edspindexfile.cc1
-rw-r--r--apt-pkg/edsp/edspindexfile.h1
-rw-r--r--apt-pkg/edsp/edsplistparser.h5
-rw-r--r--apt-pkg/indexfile.h2
-rw-r--r--apt-pkg/indexrecords.cc3
-rw-r--r--apt-pkg/indexrecords.h1
-rw-r--r--apt-pkg/init.cc2
-rw-r--r--apt-pkg/init.h4
-rw-r--r--apt-pkg/metaindex.h3
-rw-r--r--apt-pkg/packagemanager.h3
-rw-r--r--apt-pkg/pkgcachegen.cc2
-rw-r--r--apt-pkg/pkgsystem.h6
-rw-r--r--apt-pkg/sourcelist.cc2
-rw-r--r--apt-pkg/sourcelist.h6
-rw-r--r--apt-pkg/srcrecords.cc1
-rw-r--r--apt-pkg/tagfile.cc1
-rw-r--r--apt-pkg/tagfile.h6
-rw-r--r--apt-pkg/vendorlist.cc2
-rw-r--r--apt-pkg/vendorlist.h5
-rw-r--r--apt-pkg/version.h3
-rw-r--r--cmdline/acqprogress.h4
-rw-r--r--cmdline/apt-cache.cc6
-rw-r--r--cmdline/apt-cdrom.cc2
-rw-r--r--cmdline/apt-config.cc1
-rw-r--r--cmdline/apt-dump-solver.cc1
-rw-r--r--cmdline/apt-extracttemplates.cc1
-rw-r--r--cmdline/apt-get.cc5
-rw-r--r--cmdline/apt-internal-solver.cc2
-rw-r--r--cmdline/apt-mark.cc1
-rw-r--r--cmdline/apt-sortpkgs.cc2
-rw-r--r--debian/changelog3
-rw-r--r--ftparchive/cachedb.cc1
-rw-r--r--ftparchive/cachedb.h8
-rw-r--r--ftparchive/contents.h3
-rw-r--r--ftparchive/multicompress.h5
-rw-r--r--ftparchive/writer.h5
-rw-r--r--methods/bzip2.cc1
-rw-r--r--methods/cdrom.cc1
-rw-r--r--methods/connect.cc2
-rw-r--r--methods/connect.h3
-rw-r--r--methods/copy.cc1
-rw-r--r--methods/file.cc1
-rw-r--r--methods/ftp.cc1
-rw-r--r--methods/ftp.h4
-rw-r--r--methods/gpgv.cc1
-rw-r--r--methods/http.cc6
-rw-r--r--methods/http.h7
-rw-r--r--methods/https.cc1
-rw-r--r--methods/https.h3
-rw-r--r--methods/mirror.cc3
-rw-r--r--methods/mirror.h25
-rw-r--r--methods/rred.cc1
-rw-r--r--methods/rsh.cc3
-rw-r--r--methods/rsh.h8
-rw-r--r--test/interactive-helper/extract-control.cc1
-rw-r--r--test/interactive-helper/test_udevcdrom.cc1
-rw-r--r--test/interactive-helper/testextract.cc2
99 files changed, 380 insertions, 232 deletions
diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc
index 4e078349e..2dee1a40d 100644
--- a/apt-inst/contrib/arfile.cc
+++ b/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>
diff --git a/apt-inst/contrib/arfile.h b/apt-inst/contrib/arfile.h
index bfc128ace..2be1323d1 100644
--- a/apt-inst/contrib/arfile.h
+++ b/apt-inst/contrib/arfile.h
@@ -17,7 +17,8 @@
#include <string>
-#include <apt-pkg/fileutl.h>
+
+class FileFd;
class ARArchive
{
diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc
index 487027c3d..12919a7cd 100644
--- a/apt-inst/contrib/extracttar.cc
+++ b/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>
diff --git a/apt-inst/contrib/extracttar.h b/apt-inst/contrib/extracttar.h
index 27c453d0d..8754e8dcc 100644
--- a/apt-inst/contrib/extracttar.h
+++ b/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
{
diff --git a/apt-inst/database.cc b/apt-inst/database.cc
index 1a94e1353..da7613491 100644
--- a/apt-inst/database.cc
+++ b/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;
+}
diff --git a/apt-inst/database.h b/apt-inst/database.h
index cd0e310bc..ccfee3797 100644
--- a/apt-inst/database.h
+++ b/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
diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc
index 8ade547f5..4bd065cf8 100644
--- a/apt-inst/deb/debfile.cc
+++ b/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>
diff --git a/apt-inst/deb/debfile.h b/apt-inst/deb/debfile.h
index e404d81db..2c4734f9e 100644
--- a/apt-inst/deb/debfile.h
+++ b/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
{
diff --git a/apt-inst/deb/dpkgdb.cc b/apt-inst/deb/dpkgdb.cc
index 3112acdbd..819c123f6 100644
--- a/apt-inst/deb/dpkgdb.cc
+++ b/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>
diff --git a/apt-inst/deb/dpkgdb.h b/apt-inst/deb/dpkgdb.h
index 3656929aa..f28563a93 100644
--- a/apt-inst/deb/dpkgdb.h
+++ b/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:
diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc
index d48ff63ac..29e163028 100644
--- a/apt-inst/extract.cc
+++ b/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>
diff --git a/apt-inst/filelist.h b/apt-inst/filelist.h
index 69c483e71..0405d61df 100644
--- a/apt-inst/filelist.h
+++ b/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
{
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index b46489f87..453fce109 100644
--- a/apt-pkg/acquire-item.cc
+++ b/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>
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index 13be17a01..24f848f27 100644
--- a/apt-pkg/acquire-item.h
+++ b/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);
};
/*}}}*/
diff --git a/apt-pkg/acquire-method.h b/apt-pkg/acquire-method.h
index 8acec82ed..c3f042ee0 100644
--- a/apt-pkg/acquire-method.h
+++ b/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
{
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 40368c91f..919daefef 100644
--- a/apt-pkg/algorithms.cc
+++ b/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>
diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h
index f299f8189..948fe1103 100644
--- a/apt-pkg/algorithms.h
+++ b/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:
diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc
index f38dfc581..1b8d91a44 100644
--- a/apt-pkg/cachefile.cc
+++ b/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>
/*}}}*/
diff --git a/apt-pkg/cachefile.h b/apt-pkg/cachefile.h
index 243061f0f..b56e42855 100644
--- a/apt-pkg/cachefile.h
+++ b/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
{
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index 464b2fdd8..5382f3838 100644
--- a/apt-pkg/cacheiterators.h
+++ b/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 */
diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc
index 386ecfb5f..6b95eab70 100644
--- a/apt-pkg/cacheset.cc
+++ b/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;
}
diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h
index 061d0a2f4..3b1118bdc 100644
--- a/apt-pkg/cacheset.h
+++ b/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(); };
};
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index 392cd890e..a9c63fd21 100644
--- a/apt-pkg/cdrom.cc
+++ b/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>
diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h
index 2241f1eba..319254fd0 100644
--- a/apt-pkg/cdrom.h
+++ b/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 /*{{{*/
{
diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc
index f5a939968..ed8fa1aa9 100644
--- a/apt-pkg/clean.cc
+++ b/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>
diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc
index 34e90da20..997f26bc7 100644
--- a/apt-pkg/contrib/cmndline.cc
+++ b/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>
diff --git a/apt-pkg/contrib/cmndline.h b/apt-pkg/contrib/cmndline.h
index 7c0c71aa7..b201d9855 100644
--- a/apt-pkg/contrib/cmndline.h
+++ b/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
{
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index a110a7019..f76169a92 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/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>
diff --git a/apt-pkg/contrib/mmap.h b/apt-pkg/contrib/mmap.h
index 387e9a170..2ed4a95f8 100644
--- a/apt-pkg/contrib/mmap.h
+++ b/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
diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc
index 9aa1376dc..cb7d36088 100644
--- a/apt-pkg/contrib/netrc.cc
+++ b/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>
diff --git a/apt-pkg/contrib/netrc.h b/apt-pkg/contrib/netrc.h
index 86afa43d1..7b94eba88 100644
--- a/apt-pkg/contrib/netrc.h
+++ b/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.
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 95a2e6d47..3652f9e8b 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/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>
diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h
index 09858d991..9519d9711 100644
--- a/apt-pkg/deb/deblistparser.h
+++ b/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
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index 1d3754b00..0d07725eb 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/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>
diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h
index 695cfa7cc..0cba2d8a8 100644
--- a/apt-pkg/deb/debmetaindex.h
+++ b/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);
};
diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc
index ef6a7ca9d..1afa7b74d 100644
--- a/apt-pkg/deb/debrecords.cc
+++ b/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>
/*}}}*/
diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h
index b75726859..9c7ea6b48 100644
--- a/apt-pkg/deb/debrecords.h
+++ b/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
{
diff --git a/apt-pkg/deb/debsystem.h b/apt-pkg/deb/debsystem.h
index 232155256..855123516 100644
--- a/apt-pkg/deb/debsystem.h
+++ b/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
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 529085b4a..529e9240d 100644
--- a/apt-pkg/depcache.cc
+++ b/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>
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index 5798f0362..f6e6c0afc 100644
--- a/apt-pkg/depcache.h
+++ b/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
{
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 44f7dbfd6..137398100 100644
--- a/apt-pkg/edsp.cc
+++ b/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"};
diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h
index 743c3f5d1..c14309422 100644
--- a/apt-pkg/edsp.h
+++ b/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ā€¦
diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc
index b417a7562..058cef636 100644
--- a/apt-pkg/edsp/edspindexfile.cc
+++ b/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>
diff --git a/apt-pkg/edsp/edspindexfile.h b/apt-pkg/edsp/edspindexfile.h
index 58a7f62a9..9670c4837 100644
--- a/apt-pkg/edsp/edspindexfile.h
+++ b/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
diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h
index 3e196cb9a..5d82716c7 100644
--- a/apt-pkg/edsp/edsplistparser.h
+++ b/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
{
diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h
index 68d53ad7e..5e162a846 100644
--- a/apt-pkg/indexfile.h
+++ b/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:
diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc
index 7b48d659e..cdb9250e8 100644
--- a/apt-pkg/indexrecords.cc
+++ b/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>
diff --git a/apt-pkg/indexrecords.h b/apt-pkg/indexrecords.h
index 66b84f8bb..fa60a0847 100644
--- a/apt-pkg/indexrecords.h
+++ b/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>
diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc
index a1cb05e38..2a709dd36 100644
--- a/apt-pkg/init.cc
+++ b/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>
diff --git a/apt-pkg/init.h b/apt-pkg/init.h
index 4cee1001a..85ad0df7e 100644
--- a/apt-pkg/init.h
+++ b/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
diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h
index 66c287c30..9cc79a7a6 100644
--- a/apt-pkg/metaindex.h
+++ b/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;
diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h
index 7ee17942c..d4989a6e0 100644
--- a/apt-pkg/packagemanager.h
+++ b/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;
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index a39aa9f59..1356054b5 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/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>
diff --git a/apt-pkg/pkgsystem.h b/apt-pkg/pkgsystem.h
index 246762e0b..211fd0d56 100644
--- a/apt-pkg/pkgsystem.h
+++ b/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
{
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index e20ec4704..46025fc74 100644
--- a/apt-pkg/sourcelist.cc
+++ b/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>
diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h
index 7b473ee64..4509e54b9 100644
--- a/apt-pkg/sourcelist.h
+++ b/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:
diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
index 8c1de2ea5..f6d2d5158 100644
--- a/apt-pkg/srcrecords.cc
+++ b/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>
/*}}}*/
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index 418e6bed8..ec86173df 100644
--- a/apt-pkg/tagfile.cc
+++ b/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>
diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h
index e3034b628..a5bf5ac90 100644
--- a/apt-pkg/tagfile.h
+++ b/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;
diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc
index 2ccb556ab..ecfc7db87 100644
--- a/apt-pkg/vendorlist.cc
+++ b/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;
diff --git a/apt-pkg/vendorlist.h b/apt-pkg/vendorlist.h
index 62ab78a33..733d23a32 100644
--- a/apt-pkg/vendorlist.h
+++ b/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:
diff --git a/apt-pkg/version.h b/apt-pkg/version.h
index c9257d116..47e1919bb 100644
--- a/apt-pkg/version.h
+++ b/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
diff --git a/cmdline/acqprogress.h b/cmdline/acqprogress.h
index 48f90ae59..8f0903923 100644
--- a/cmdline/acqprogress.h
+++ b/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);
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index a4cdf784e..82a31c9b1 100644
--- a/cmdline/apt-cache.cc
+++ b/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>
/*}}}*/
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc
index 8608b1215..fa48debcd 100644
--- a/cmdline/apt-cdrom.cc
+++ b/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>
diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc
index df2958975..94f6ee9b0 100644
--- a/cmdline/apt-config.cc
+++ b/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>
diff --git a/cmdline/apt-dump-solver.cc b/cmdline/apt-dump-solver.cc
index dab0cc6fd..e82e15c6e 100644
--- a/cmdline/apt-dump-solver.cc
+++ b/cmdline/apt-dump-solver.cc
@@ -12,6 +12,7 @@
#include <config.h>
#include <cstdio>
+#include <iostream>
/*}}}*/
// ShowHelp - Show a help screen /*{{{*/
diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc
index 5d7b76c23..d5c1a3208 100644
--- a/cmdline/apt-extracttemplates.cc
+++ b/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>
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index d8f207f0a..5e950332f 100644
--- a/cmdline/apt-get.cc
+++ b/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"
diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc
index ef6c688fe..1b636e4d5 100644
--- a/cmdline/apt-internal-solver.cc
+++ b/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>
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index 8c9a47913..339cbdf44 100644
--- a/cmdline/apt-mark.cc
+++ b/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>
diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc
index 44b74cf6c..20ae14f2a 100644
--- a/cmdline/apt-sortpkgs.cc
+++ b/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>
diff --git a/debian/changelog b/debian/changelog
index 8a4994a32..aa98cfbd1 100644
--- a/debian/changelog
+++ b/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
diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc
index 7d8718c56..c4db88811 100644
--- a/ftparchive/cachedb.cc
+++ b/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
diff --git a/ftparchive/cachedb.h b/ftparchive/cachedb.h
index f2e1e19e4..377c41607 100644
--- a/ftparchive/cachedb.h
+++ b/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:
diff --git a/ftparchive/contents.h b/ftparchive/contents.h
index cdd8abd5c..4af9db574 100644
--- a/ftparchive/contents.h
+++ b/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
diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h
index 19e5065fa..5496b06d0 100644
--- a/ftparchive/multicompress.h
+++ b/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>
diff --git a/ftparchive/writer.h b/ftparchive/writer.h
index a43b83876..76a3dfd1e 100644
--- a/ftparchive/writer.h
+++ b/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;
diff --git a/methods/bzip2.cc b/methods/bzip2.cc
index ad5db6cfb..8e7e46557 100644
--- a/methods/bzip2.cc
+++ b/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>
diff --git a/methods/cdrom.cc b/methods/cdrom.cc
index bc115d259..e7114b168 100644
--- a/methods/cdrom.cc
+++ b/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>
diff --git a/methods/connect.cc b/methods/connect.cc
index ba2264faa..9a092a43c 100644
--- a/methods/connect.cc
+++ b/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>
diff --git a/methods/connect.h b/methods/connect.h
index 0afa00919..bbe1bb35d 100644
--- a/methods/connect.h
+++ b/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);
diff --git a/methods/copy.cc b/methods/copy.cc
index fe2918469..f8d58e479 100644
--- a/methods/copy.cc
+++ b/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>
diff --git a/methods/file.cc b/methods/file.cc
index d58652e6e..5025c996d 100644
--- a/methods/file.cc
+++ b/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>
diff --git a/methods/ftp.cc b/methods/ftp.cc
index 861647aea..2ca0ac6f7 100644
--- a/methods/ftp.cc
+++ b/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>
diff --git a/methods/ftp.h b/methods/ftp.h
index 7088e0954..2634f0732 100644
--- a/methods/ftp.h
+++ b/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];
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index 67cbd36a2..2b2aba017 100644
--- a/methods/gpgv.cc
+++ b/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>
diff --git a/methods/http.cc b/methods/http.cc
index b60cfeb9e..0d81c73ed 100644
--- a/methods/http.cc
+++ b/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 /*{{{*/
// ---------------------------------------------------------------------
diff --git a/methods/http.h b/methods/http.h
index 08823d1b1..c73d4df5c 100644
--- a/methods/http.h
+++ b/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
diff --git a/methods/https.cc b/methods/https.cc
index 06a0e285a..e70206dfb 100644
--- a/methods/https.cc
+++ b/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>
diff --git a/methods/https.h b/methods/https.h
index 3f0c416b6..b7adeb880 100644
--- a/methods/https.h
+++ b/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
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 61a7f12fd..3d5983efa 100644
--- a/methods/mirror.cc
+++ b/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>
diff --git a/methods/mirror.h b/methods/mirror.h
index 97d18144a..81e531e21 100644
--- a/methods/mirror.h
+++ b/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();
diff --git a/methods/rred.cc b/methods/rred.cc
index 2a05acce1..ef00fcaa3 100644
--- a/methods/rred.cc
+++ b/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>
diff --git a/methods/rsh.cc b/methods/rsh.cc
index add128c49..da9777fc4 100644
--- a/methods/rsh.cc
+++ b/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>
diff --git a/methods/rsh.h b/methods/rsh.h
index 7bebe29a0..d7efa3f06 100644
--- a/methods/rsh.h
+++ b/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);
diff --git a/test/interactive-helper/extract-control.cc b/test/interactive-helper/extract-control.cc
index 29dcbf371..a1b3600aa 100644
--- a/test/interactive-helper/extract-control.cc
+++ b/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>
diff --git a/test/interactive-helper/test_udevcdrom.cc b/test/interactive-helper/test_udevcdrom.cc
index bbedc0ab5..88f5f0153 100644
--- a/test/interactive-helper/test_udevcdrom.cc
+++ b/test/interactive-helper/test_udevcdrom.cc
@@ -3,6 +3,7 @@
#include <assert.h>
#include <vector>
+#include <iostream>
int main()
{
diff --git a/test/interactive-helper/testextract.cc b/test/interactive-helper/testextract.cc
index b790df618..f7ddb72f0 100644
--- a/test/interactive-helper/testextract.cc
+++ b/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>