From 472ff00ef2e48383805d281c6364ec27839e3f4d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 19 Sep 2011 19:14:19 +0200 Subject: [PATCH] use forward declaration in headers if possible instead of includes --- apt-inst/contrib/arfile.cc | 1 + apt-inst/contrib/arfile.h | 3 +- apt-inst/contrib/extracttar.cc | 1 + apt-inst/contrib/extracttar.h | 5 +- apt-inst/database.cc | 7 + apt-inst/database.h | 8 +- apt-inst/deb/debfile.cc | 1 + apt-inst/deb/debfile.h | 5 +- apt-inst/deb/dpkgdb.cc | 2 + apt-inst/deb/dpkgdb.h | 5 + apt-inst/extract.cc | 1 + apt-inst/filelist.h | 3 +- apt-pkg/acquire-item.cc | 2 + apt-pkg/acquire-item.h | 238 ++++++++++----------- apt-pkg/acquire-method.h | 6 +- apt-pkg/algorithms.cc | 3 + apt-pkg/algorithms.h | 3 +- apt-pkg/cachefile.cc | 1 + apt-pkg/cachefile.h | 9 +- apt-pkg/cacheiterators.h | 1 + apt-pkg/cacheset.cc | 7 +- apt-pkg/cacheset.h | 13 +- apt-pkg/cdrom.cc | 2 + apt-pkg/cdrom.h | 3 +- apt-pkg/clean.cc | 1 + apt-pkg/contrib/cmndline.cc | 1 + apt-pkg/contrib/cmndline.h | 4 +- apt-pkg/contrib/mmap.cc | 1 + apt-pkg/contrib/mmap.h | 3 +- apt-pkg/contrib/netrc.cc | 2 + apt-pkg/contrib/netrc.h | 4 +- apt-pkg/deb/deblistparser.cc | 1 + apt-pkg/deb/deblistparser.h | 1 - apt-pkg/deb/debmetaindex.cc | 3 + apt-pkg/deb/debmetaindex.h | 113 +++++----- apt-pkg/deb/debrecords.cc | 2 + apt-pkg/deb/debrecords.h | 2 +- apt-pkg/deb/debsystem.h | 4 +- apt-pkg/depcache.cc | 2 +- apt-pkg/depcache.h | 5 +- apt-pkg/edsp.cc | 7 + apt-pkg/edsp.h | 11 +- apt-pkg/edsp/edspindexfile.cc | 1 + apt-pkg/edsp/edspindexfile.h | 1 - apt-pkg/edsp/edsplistparser.h | 5 +- apt-pkg/indexfile.h | 2 + apt-pkg/indexrecords.cc | 3 + apt-pkg/indexrecords.h | 1 - apt-pkg/init.cc | 2 + apt-pkg/init.h | 4 +- apt-pkg/metaindex.h | 3 - apt-pkg/packagemanager.h | 3 +- apt-pkg/pkgcachegen.cc | 2 + apt-pkg/pkgsystem.h | 6 +- apt-pkg/sourcelist.cc | 2 + apt-pkg/sourcelist.h | 6 +- apt-pkg/srcrecords.cc | 1 + apt-pkg/tagfile.cc | 1 + apt-pkg/tagfile.h | 6 +- apt-pkg/vendorlist.cc | 2 + apt-pkg/vendorlist.h | 5 +- apt-pkg/version.h | 3 +- cmdline/acqprogress.h | 4 +- cmdline/apt-cache.cc | 6 +- cmdline/apt-cdrom.cc | 2 + cmdline/apt-config.cc | 1 + cmdline/apt-dump-solver.cc | 1 + cmdline/apt-extracttemplates.cc | 1 + cmdline/apt-get.cc | 5 + cmdline/apt-internal-solver.cc | 2 + cmdline/apt-mark.cc | 1 + cmdline/apt-sortpkgs.cc | 2 + debian/changelog | 3 +- ftparchive/cachedb.cc | 1 + ftparchive/cachedb.h | 8 +- ftparchive/contents.h | 3 +- ftparchive/multicompress.h | 5 +- ftparchive/writer.h | 5 +- methods/bzip2.cc | 1 + methods/cdrom.cc | 1 + methods/connect.cc | 2 + methods/connect.h | 3 +- methods/copy.cc | 1 + methods/file.cc | 1 + methods/ftp.cc | 1 + methods/ftp.h | 4 + methods/gpgv.cc | 1 + methods/http.cc | 6 + methods/http.h | 7 +- methods/https.cc | 1 + methods/https.h | 3 +- methods/mirror.cc | 3 +- methods/mirror.h | 25 +-- methods/rred.cc | 1 + methods/rsh.cc | 3 + methods/rsh.h | 8 +- test/interactive-helper/extract-control.cc | 1 + test/interactive-helper/test_udevcdrom.cc | 1 + test/interactive-helper/testextract.cc | 2 + 99 files changed, 415 insertions(+), 267 deletions(-) rewrite apt-pkg/deb/debmetaindex.h (67%) diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index 4e078349..2dee1a40 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -18,6 +18,7 @@ #include #include +#include #include #include diff --git a/apt-inst/contrib/arfile.h b/apt-inst/contrib/arfile.h index bfc128ac..2be1323d 100644 --- a/apt-inst/contrib/arfile.h +++ b/apt-inst/contrib/arfile.h @@ -17,7 +17,8 @@ #include -#include + +class FileFd; class ARArchive { diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 487027c3..12919a7c 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -18,6 +18,7 @@ // Include Files /*{{{*/ #include +#include #include #include #include diff --git a/apt-inst/contrib/extracttar.h b/apt-inst/contrib/extracttar.h index 27c453d0..8754e8dc 100644 --- a/apt-inst/contrib/extracttar.h +++ b/apt-inst/contrib/extracttar.h @@ -15,9 +15,10 @@ #define PKGLIB_EXTRACTTAR_H #include -#include -#include +#include + +class pkgDirStream; class ExtractTar { diff --git a/apt-inst/database.cc b/apt-inst/database.cc index 1a94e135..da761349 100644 --- a/apt-inst/database.cc +++ b/apt-inst/database.cc @@ -11,6 +11,8 @@ #include #include +#include +#include /*}}}*/ // 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 cd0e310b..ccfee379 100644 --- a/apt-inst/database.h +++ b/apt-inst/database.h @@ -21,9 +21,13 @@ #ifndef PKGLIB_DATABASE_H #define PKGLIB_DATABASE_H -#include #include +#include + +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 8ade547f..4bd065cf 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -18,6 +18,7 @@ // Include Files /*{{{*/ #include +#include #include #include #include diff --git a/apt-inst/deb/debfile.h b/apt-inst/deb/debfile.h index e404d81d..2c4734f9 100644 --- a/apt-inst/deb/debfile.h +++ b/apt-inst/deb/debfile.h @@ -25,9 +25,12 @@ #include -#include #include #include +#include + +class FileFd; +class pkgDataBase; class debDebFile { diff --git a/apt-inst/deb/dpkgdb.cc b/apt-inst/deb/dpkgdb.cc index 3112acdb..819c123f 100644 --- a/apt-inst/deb/dpkgdb.cc +++ b/apt-inst/deb/dpkgdb.cc @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-inst/deb/dpkgdb.h b/apt-inst/deb/dpkgdb.h index 3656929a..f28563a9 100644 --- a/apt-inst/deb/dpkgdb.h +++ b/apt-inst/deb/dpkgdb.h @@ -22,6 +22,11 @@ #include +#include + +class DynamicMMap; +class OpProgress; + class debDpkgDB : public pkgDataBase { protected: diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc index d48ff63a..29e16302 100644 --- a/apt-inst/extract.cc +++ b/apt-inst/extract.cc @@ -49,6 +49,7 @@ #include #include #include +#include #include #include diff --git a/apt-inst/filelist.h b/apt-inst/filelist.h index 69c483e7..0405d61d 100644 --- a/apt-inst/filelist.h +++ b/apt-inst/filelist.h @@ -28,9 +28,10 @@ #ifndef PKGLIB_FILELIST_H #define PKGLIB_FILELIST_H +#include #include -#include +#include class pkgFLCache { diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index b46489f8..453fce10 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 13be17a0..24f848f2 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -21,13 +21,9 @@ #define PKGLIB_ACQUIRE_ITEM_H #include -#include -#include -#include -#include -#include #include #include +#include /** \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 available_patches; + std::vector 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 diffs=vector()); + pkgAcqIndexDiffs(pkgAcquire *Owner,std::string URI,std::string URIDesc, + std::string ShortDesc, HashString ExpectedHash, + std::string ServerSha1, + std::vector diffs=std::vector()); }; /*}}}*/ /** \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* IndexTargets; + const std::vector* 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* 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* 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* IndexTargets; + const std::vector* 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* IndexTargets, + std::string URI,std::string URIDesc, std::string ShortDesc, + std::string SigFile, + const std::vector* 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* 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* 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 8acec82e..c3f042ee 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 -#include - #include +#include +#include + class Hashes; class pkgAcqMethod { diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 40368c91..919daefe 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -23,6 +23,9 @@ #include #include #include +#include +#include +#include #include #include diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index f299f818..948fe110 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -33,10 +33,11 @@ #include #include -#include #include +class pkgAcquireStatus; + class pkgSimulate : public pkgPackageManager /*{{{*/ { protected: diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index f38dfc58..1b8d91a4 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include /*}}}*/ diff --git a/apt-pkg/cachefile.h b/apt-pkg/cachefile.h index 243061f0..b56e4285 100644 --- a/apt-pkg/cachefile.h +++ b/apt-pkg/cachefile.h @@ -17,11 +17,12 @@ #ifndef PKGLIB_CACHEFILE_H #define PKGLIB_CACHEFILE_H - #include -#include -#include -#include +#include + +class pkgPolicy; +class pkgSourceList; +class OpProgress; class pkgCacheFile { diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 464b2fdd..5382f383 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -32,6 +32,7 @@ #include #include + // 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 386ecfb5..6b95eab7 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -12,11 +12,14 @@ #include #include +#include #include #include #include #include #include +#include +#include #include @@ -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 061d0a2f..3b1118bd 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -16,9 +16,12 @@ #include #include -#include +#include #include /*}}}*/ + +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 392cd890..a9c63fd2 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h index 2241f1eb..319254fd 100644 --- a/apt-pkg/cdrom.h +++ b/apt-pkg/cdrom.h @@ -1,10 +1,11 @@ #ifndef PKGLIB_CDROM_H #define PKGLIB_CDROM_H -#include #include #include +class Configuration; +class OpProgress; class pkgCdromStatus /*{{{*/ { diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc index f5a93996..ed8fa1aa 100644 --- a/apt-pkg/clean.cc +++ b/apt-pkg/clean.cc @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc index 34e90da2..997f26bc 100644 --- a/apt-pkg/contrib/cmndline.cc +++ b/apt-pkg/contrib/cmndline.cc @@ -13,6 +13,7 @@ // Include files /*{{{*/ #include +#include #include #include #include diff --git a/apt-pkg/contrib/cmndline.h b/apt-pkg/contrib/cmndline.h index 7c0c71aa..b201d985 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 +class Configuration; class CommandLine { diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index a110a701..f76169a9 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -21,6 +21,7 @@ #include #include +#include #include #include diff --git a/apt-pkg/contrib/mmap.h b/apt-pkg/contrib/mmap.h index 387e9a17..2ed4a95f 100644 --- a/apt-pkg/contrib/mmap.h +++ b/apt-pkg/contrib/mmap.h @@ -27,7 +27,8 @@ #include -#include + +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 9aa1376d..cb7d3608 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -14,7 +14,9 @@ #include #include +#include #include + #include #include #include diff --git a/apt-pkg/contrib/netrc.h b/apt-pkg/contrib/netrc.h index 86afa43d..7b94eba8 100644 --- a/apt-pkg/contrib/netrc.h +++ b/apt-pkg/contrib/netrc.h @@ -14,11 +14,13 @@ #ifndef NETRC_H #define NETRC_H -#include +#include #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 95a2e6d4..3652f9e8 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 09858d99..9519d971 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -12,7 +12,6 @@ #define PKGLIB_DEBLISTPARSER_H #include -#include #include class debListParser : public pkgCacheGenerator::ListParser diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 1d3754b0..0d07725e 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -4,9 +4,12 @@ #include #include #include +#include #include #include #include +#include +#include #include #include diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h dissimilarity index 67% index 695cfa7c..0cba2d8a 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -1,56 +1,57 @@ -// ijones, walters -#ifndef PKGLIB_DEBMETAINDEX_H -#define PKGLIB_DEBMETAINDEX_H - -#include -#include - -#include - -class debReleaseIndex : public metaIndex { - public: - - class debSectionEntry - { - public: - debSectionEntry (string const &Section, bool const &IsSrc); - string const Section; - bool const IsSrc; - }; - - private: - /** \brief dpointer placeholder (for later in case we need it) */ - void *d; - std::map > 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); - virtual ~debReleaseIndex(); - - virtual string ArchiveURI(string const &File) const {return URI + File;}; - virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; - vector * 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 *GetIndexFiles(); - - void SetTrusted(bool const Trusted); - virtual bool IsTrusted() const; - - void PushSectionEntry(vector const &Archs, const debSectionEntry *Entry); - void PushSectionEntry(string const &Arch, const debSectionEntry *Entry); - void PushSectionEntry(const debSectionEntry *Entry); -}; - -#endif +// ijones, walters +#ifndef PKGLIB_DEBMETAINDEX_H +#define PKGLIB_DEBMETAINDEX_H + +#include + +#include +#include +#include + +class debReleaseIndex : public metaIndex { + public: + + class debSectionEntry + { + public: + 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 > ArchEntries; + enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; + + public: + + debReleaseIndex(std::string const &URI, std::string const &Dist); + debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted); + virtual ~debReleaseIndex(); + + virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; + virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; + std::vector * 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 *GetIndexFiles(); + + void SetTrusted(bool const Trusted); + virtual bool IsTrusted() const; + + void PushSectionEntry(std::vector const &Archs, const debSectionEntry *Entry); + void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry); + void PushSectionEntry(const debSectionEntry *Entry); +}; + +#endif diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc index ef6a7ca9..1afa7b74 100644 --- a/apt-pkg/deb/debrecords.cc +++ b/apt-pkg/deb/debrecords.cc @@ -14,6 +14,8 @@ #include #include #include +#include + #include /*}}}*/ diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h index b7572685..9c7ea6b4 100644 --- a/apt-pkg/deb/debrecords.h +++ b/apt-pkg/deb/debrecords.h @@ -15,8 +15,8 @@ #define PKGLIB_DEBRECORDS_H #include -#include #include +#include class debRecordParser : public pkgRecords::Parser { diff --git a/apt-pkg/deb/debsystem.h b/apt-pkg/deb/debsystem.h index 23215525..85512351 100644 --- a/apt-pkg/deb/debsystem.h +++ b/apt-pkg/deb/debsystem.h @@ -11,10 +11,12 @@ #define PKGLIB_DEBSYSTEM_H #include +#include 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 529085b4..529e9240 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -16,13 +16,13 @@ #include #include #include - #include #include #include #include #include #include +#include #include #include diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 5798f036..f6e6c0af 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -40,12 +40,13 @@ #include #include -#include -#include #include #include #include +#include + +class OpProgress; class pkgDepCache : protected pkgCache::Namespace { diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 44f7dbfd..13739810 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -9,17 +9,24 @@ #include #include +#include #include #include #include #include +#include +#include #include #include +#include + #include /*}}}*/ +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 743c3f5d..c1430942 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -9,12 +9,17 @@ #ifndef PKGLIB_EDSP_H #define PKGLIB_EDSP_H -#include -#include -#include +#include +#include #include +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 b417a756..058cef63 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff --git a/apt-pkg/edsp/edspindexfile.h b/apt-pkg/edsp/edspindexfile.h index 58a7f62a..9670c483 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 #include class edspIndex : public debStatusIndex diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h index 3e196cb9..5d82716c 100644 --- a/apt-pkg/edsp/edsplistparser.h +++ b/apt-pkg/edsp/edsplistparser.h @@ -12,9 +12,8 @@ #define PKGLIB_EDSPLISTPARSER_H #include -#include -#include -#include + +class FileFd; class edspListParser : public debListParser { diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 68d53ad7..5e162a84 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -27,10 +27,12 @@ #include #include #include +#include class pkgAcquire; class pkgCacheGenerator; class OpProgress; + class pkgIndexFile { protected: diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc index 7b48d659..cdb9250e 100644 --- a/apt-pkg/indexrecords.cc +++ b/apt-pkg/indexrecords.cc @@ -10,6 +10,9 @@ #include #include #include +#include +#include + #include #include diff --git a/apt-pkg/indexrecords.h b/apt-pkg/indexrecords.h index 66b84f8b..fa60a084 100644 --- a/apt-pkg/indexrecords.h +++ b/apt-pkg/indexrecords.h @@ -7,7 +7,6 @@ #include -#include #include #include diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index a1cb05e3..2a709dd3 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-pkg/init.h b/apt-pkg/init.h index 4cee1001..85ad0df7 100644 --- a/apt-pkg/init.h +++ b/apt-pkg/init.h @@ -13,8 +13,8 @@ #ifndef PKGLIB_INIT_H #define PKGLIB_INIT_H -#include -#include +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 66c287c3..9cc79a7a 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -4,10 +4,7 @@ #include #include -#include -#include #include -#include class pkgAcquire; class pkgCacheGenerator; diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h index 7ee17942..d4989a6e 100644 --- a/apt-pkg/packagemanager.h +++ b/apt-pkg/packagemanager.h @@ -23,11 +23,10 @@ #ifndef PKGLIB_PACKAGEMANAGER_H #define PKGLIB_PACKAGEMANAGER_H +#include #include #include -#include -#include #include class pkgAcquire; diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index a39aa9f5..1356054b 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-pkg/pkgsystem.h b/apt-pkg/pkgsystem.h index 246762e0..211fd0d5 100644 --- a/apt-pkg/pkgsystem.h +++ b/apt-pkg/pkgsystem.h @@ -37,14 +37,16 @@ #ifndef PKGLIB_PKGSYSTEM_H #define PKGLIB_PKGSYSTEM_H +#include -#include #include - + +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 e20ec470..46025fc7 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h index 7b473ee6..4509e54b 100644 --- a/apt-pkg/sourcelist.h +++ b/apt-pkg/sourcelist.h @@ -31,13 +31,15 @@ #include #include #include -#include 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 8c1de2ea..f6d2d515 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include /*}}}*/ diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 418e6bed..ec86173d 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index e3034b62..a5bf5ac9 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -20,10 +20,12 @@ #ifndef PKGLIB_TAGFILE_H #define PKGLIB_TAGFILE_H - -#include #include +#include + +class FileFd; + class pkgTagSection { const char *Section; diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc index 2ccb556a..ecfc7db8 100644 --- a/apt-pkg/vendorlist.cc +++ b/apt-pkg/vendorlist.cc @@ -2,12 +2,14 @@ #include #include +#include #include #if __GNUC__ >= 4 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif +#include #include using std::string; diff --git a/apt-pkg/vendorlist.h b/apt-pkg/vendorlist.h index 62ab78a3..733d23a3 100644 --- a/apt-pkg/vendorlist.h +++ b/apt-pkg/vendorlist.h @@ -15,10 +15,11 @@ #include #include -#include -#include #include +class Vendor; +class Configuration; + class __deprecated pkgVendorList { protected: diff --git a/apt-pkg/version.h b/apt-pkg/version.h index c9257d11..47e1919b 100644 --- a/apt-pkg/version.h +++ b/apt-pkg/version.h @@ -20,8 +20,7 @@ #ifndef PKGLIB_VERSION_H #define PKGLIB_VERSION_H - -#include +#include #include class pkgVersioningSystem diff --git a/cmdline/acqprogress.h b/cmdline/acqprogress.h index 48f90ae5..8f090392 100644 --- a/cmdline/acqprogress.h +++ b/cmdline/acqprogress.h @@ -12,6 +12,8 @@ #include +#include + 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 a4cdf784..82a31c9b 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -16,7 +16,6 @@ #include #include -#include #include #include #include @@ -24,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +31,9 @@ #include #include #include +#include +#include +#include #include #include @@ -40,6 +43,7 @@ #include #include #include +#include #include /*}}}*/ diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index 8608b121..fa48debc 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc index df295897..94f6ee9b 100644 --- a/cmdline/apt-config.cc +++ b/cmdline/apt-config.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/cmdline/apt-dump-solver.cc b/cmdline/apt-dump-solver.cc index dab0cc6f..e82e15c6 100644 --- a/cmdline/apt-dump-solver.cc +++ b/cmdline/apt-dump-solver.cc @@ -12,6 +12,7 @@ #include #include +#include /*}}}*/ // ShowHelp - Show a help screen /*{{{*/ diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index 5d7b76c2..d5c1a320 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index d8f207f0..5e950332 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,10 @@ #include #include #include +#include +#include +#include +#include #include "acqprogress.h" diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index ef6c688f..1b636e4d 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -11,10 +11,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index 8c9a4791..339cbdf4 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc index 44b74cf6..20ae14f2 100644 --- a/cmdline/apt-sortpkgs.cc +++ b/cmdline/apt-sortpkgs.cc @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include diff --git a/debian/changelog b/debian/changelog index 8a4994a3..aa98cfbd 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 Mon, 19 Sep 2011 13:25:58 +0200 + -- David Kalnischkies 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 7d8718c5..c4db8881 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include // htonl, etc diff --git a/ftparchive/cachedb.h b/ftparchive/cachedb.h index f2e1e19e..377c4160 100644 --- a/ftparchive/cachedb.h +++ b/ftparchive/cachedb.h @@ -13,16 +13,16 @@ #define CACHEDB_H +#include #include -#include -#include #include #include #include - +#include + #include "contents.h" - + class CacheDB { protected: diff --git a/ftparchive/contents.h b/ftparchive/contents.h index cdd8abd5..4af9db57 100644 --- a/ftparchive/contents.h +++ b/ftparchive/contents.h @@ -12,9 +12,10 @@ #include #include -#include #include +class debDebFile; + class GenContents { struct Node diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h index 19e5065f..5496b06d 100644 --- a/ftparchive/multicompress.h +++ b/ftparchive/multicompress.h @@ -16,11 +16,10 @@ #ifndef MULTICOMPRESS_H #define MULTICOMPRESS_H - - -#include #include #include + +#include #include #include diff --git a/ftparchive/writer.h b/ftparchive/writer.h index a43b8387..76a3dfd1 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -22,7 +22,6 @@ #include #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 ad5db6cf..8e7e4655 100644 --- a/methods/bzip2.cc +++ b/methods/bzip2.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #include diff --git a/methods/cdrom.cc b/methods/cdrom.cc index bc115d25..e7114b16 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/methods/connect.cc b/methods/connect.cc index ba2264fa..9a092a43 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -15,6 +15,8 @@ #include #include +#include +#include #include #include diff --git a/methods/connect.h b/methods/connect.h index 0afa0091..bbe1bb35 100644 --- a/methods/connect.h +++ b/methods/connect.h @@ -11,7 +11,8 @@ #define CONNECT_H #include -#include + +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 fe291846..f8d58e47 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -12,6 +12,7 @@ #include #include +#include #include #include #include diff --git a/methods/file.cc b/methods/file.cc index d58652e6..5025c996 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/methods/ftp.cc b/methods/ftp.cc index 861647ae..2ca0ac6f 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/methods/ftp.h b/methods/ftp.h index 7088e095..2634f073 100644 --- a/methods/ftp.h +++ b/methods/ftp.h @@ -10,6 +10,10 @@ #ifndef APT_FTP_H #define APT_FTP_H +#include + +#include + class FTPConn { char Buffer[1024*10]; diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 67cbd36a..2b2aba01 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -5,6 +5,7 @@ #include #include #include +#include #include #include diff --git a/methods/http.cc b/methods/http.cc index b60cfeb9..0d81c73e 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -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 08823d1b..c73d4df5 100644 --- a/methods/http.h +++ b/methods/http.h @@ -13,12 +13,15 @@ #define MAXLEN 360 -#include +#include + +#include 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 06a0e285..e70206df 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/methods/https.h b/methods/https.h index 3f0c416b..b7adeb88 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 URI Proxy; #endif diff --git a/methods/mirror.cc b/methods/mirror.cc index 61a7f12f..3d5983ef 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -18,7 +18,8 @@ #include #include #include - +#include +#include #include #include diff --git a/methods/mirror.h b/methods/mirror.h index 97d18144..81e531e2 100644 --- a/methods/mirror.h +++ b/methods/mirror.h @@ -11,8 +11,9 @@ #ifndef APT_MIRROR_H #define APT_MIRROR_H - #include +#include +#include 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 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 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 2a05acce..ef00fcaa 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/methods/rsh.cc b/methods/rsh.cc index add128c4..da9777fc 100644 --- a/methods/rsh.cc +++ b/methods/rsh.cc @@ -14,6 +14,9 @@ #include #include +#include +#include +#include #include #include diff --git a/methods/rsh.h b/methods/rsh.h index 7bebe29a..d7efa3f0 100644 --- a/methods/rsh.h +++ b/methods/rsh.h @@ -12,9 +12,9 @@ #include #include -#include -#include -#include + +class Hashes; +class FileFd; class RSHConn { @@ -50,6 +50,8 @@ class RSHConn ~RSHConn(); }; +#include + 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 29dcbf37..a1b3600a 100644 --- a/test/interactive-helper/extract-control.cc +++ b/test/interactive-helper/extract-control.cc @@ -1,5 +1,6 @@ #include #include +#include #include #include diff --git a/test/interactive-helper/test_udevcdrom.cc b/test/interactive-helper/test_udevcdrom.cc index bbedc0ab..88f5f015 100644 --- a/test/interactive-helper/test_udevcdrom.cc +++ b/test/interactive-helper/test_udevcdrom.cc @@ -3,6 +3,7 @@ #include #include +#include int main() { diff --git a/test/interactive-helper/testextract.cc b/test/interactive-helper/testextract.cc index b790df61..f7ddb72f 100644 --- a/test/interactive-helper/testextract.cc +++ b/test/interactive-helper/testextract.cc @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include #include -- 2.20.1