revert 2184.1.2: do not pollute namespace in headers
authorDavid Kalnischkies <kalnischkies@gmail.com>
Mon, 12 Dec 2011 23:54:37 +0000 (00:54 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Mon, 12 Dec 2011 23:54:37 +0000 (00:54 +0100)
The breakage is just to big for now, so guard the change with
#ifndef APT_8_CLEANER_HEADERS and be nice to library users

26 files changed:
apt-inst/contrib/extracttar.h
apt-pkg/acquire.h
apt-pkg/algorithms.h
apt-pkg/cdrom.h
apt-pkg/contrib/cdromutl.h
apt-pkg/contrib/configuration.h
apt-pkg/contrib/fileutl.h
apt-pkg/contrib/hashes.h
apt-pkg/contrib/hashsum_template.h
apt-pkg/contrib/md5.h
apt-pkg/contrib/mmap.h
apt-pkg/contrib/progress.h
apt-pkg/contrib/sha1.h
apt-pkg/contrib/strutl.h
apt-pkg/deb/dpkgpm.h
apt-pkg/indexcopy.h
apt-pkg/indexfile.h
apt-pkg/metaindex.h
apt-pkg/packagemanager.h
apt-pkg/pkgcache.h
apt-pkg/policy.h
apt-pkg/srcrecords.h
apt-pkg/vendor.h
apt-pkg/vendorlist.h
apt-pkg/version.h
apt-pkg/versionmatch.h

index 8754e8d..e104417 100644 (file)
 
 #include <string>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::min;
+#endif
+
 class pkgDirStream;
 
 class ExtractTar
index 9377240..3d5d7a4 100644 (file)
 #include <sys/time.h>
 #include <unistd.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::vector;
+using std::string;
+#endif
+
 class pkgAcquireStatus;
 
 /** \brief The core download scheduler.                                        {{{
index 948fe11..fdb64fc 100644 (file)
 
 #include <iostream>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::ostream;
+#endif
+
 class pkgAcquireStatus;
 
 class pkgSimulate : public pkgPackageManager                           /*{{{*/
index 319254f..4fcf5ab 100644 (file)
@@ -4,6 +4,10 @@
 #include<string>
 #include<vector>
 
+#ifndef APT_8_CLEANER_HEADERS
+using namespace std;
+#endif
+
 class Configuration;
 class OpProgress;
 
index 2c6afac..e94045b 100644 (file)
 
 #include <string>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 // mount cdrom, DeviceName (e.g. /dev/sr0) is optional
 bool MountCdrom(std::string Path, std::string DeviceName="");
 bool UnmountCdrom(std::string Path);
index f6f2a3c..4c2e750 100644 (file)
 #include <vector>
 #include <iostream>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class Configuration
 {
    public:
index f96dc72..8a986b8 100644 (file)
 
 #include <zlib.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 /* Define this for python-apt */
 #define APT_HAS_GZIP 1
 
index 81851de..b206ecc 100644 (file)
 #include <vector>
 #include <cstring>
 
+
+#ifndef APT_8_CLEANER_HEADERS
+using std::min;
+using std::vector;
+#endif
+
 // helper class that contains hash function name
 // and hash
 class HashString
index 27d192b..6301ac9 100644 (file)
 #include <algorithm>
 #include <stdint.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::min;
+#endif
+
 template<int N>
 class HashSumValue
 {
index a207da4..25631b1 100644 (file)
 
 #include "hashsum_template.h"
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::min;
+#endif
+
 typedef HashSumValue<128> MD5SumValue;
 
 class MD5Summation : public SummationImplementation
index 2ed4a95..602de94 100644 (file)
 
 #include <string>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class FileFd;
 
 /* This should be a 32 bit type, larger tyes use too much ram and smaller
index 7635719..3a6943a 100644 (file)
 #include <string>
 #include <sys/time.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class Configuration;
 class OpProgress
 {
index b4b139a..a8d55eb 100644 (file)
 
 #include "hashsum_template.h"
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::min;
+#endif
+
 typedef  HashSumValue<160> SHA1SumValue;
 
 class SHA1Summation : public SummationImplementation
index 93f4bef..337139d 100644 (file)
 
 #include "macros.h"
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::vector;
+using std::ostream;
+#endif
+
 bool UTF8ToCodeset(const char *codeset, const std::string &orig, std::string *dest);
 char *_strstrip(char *String);
 char *_strtabexpand(char *String,size_t Len);
index 6b62360..aab39f6 100644 (file)
 #include <map>
 #include <stdio.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::vector;
+using std::map;
+#endif
+
 class pkgDPkgPMPrivate;
 
 class pkgDPkgPM : public pkgPackageManager
index 21294ae..e3de1af 100644 (file)
 #include <string>
 #include <stdio.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::vector;
+#endif
+
 class pkgTagSection;
 class FileFd;
 class indexRecords;
index 5e162a8..1d34dc7 100644 (file)
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/macros.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgAcquire;
 class pkgCacheGenerator;
 class OpProgress;
index 9cc79a7..0f95257 100644 (file)
@@ -6,6 +6,10 @@
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/indexfile.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgAcquire;
 class pkgCacheGenerator;
 class OpProgress;
index d4989a6..1d80779 100644 (file)
 #include <iostream>
 #include <set>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgAcquire;
 class pkgDepCache;
 class pkgSourceList;
index fd1a021..1a70135 100644 (file)
 #ifndef PKGLIB_PKGCACHE_H
 #define PKGLIB_PKGCACHE_H
 
-
 #include <string>
 #include <time.h>
 #include <apt-pkg/mmap.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgVersioningSystem;
 class pkgCache                                                         /*{{{*/
 {
index 3c8246e..5172a3c 100644 (file)
 #include <apt-pkg/versionmatch.h>
 #include <vector>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::vector;
+#endif
+
 class pkgPolicy : public pkgDepCache::Policy
 {
    protected:
index a55bc74..06f0dce 100644 (file)
 #include <string>
 #include <vector>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::vector;
+#endif
+
 class pkgSourceList;
 class pkgIndexFile;
 class pkgSrcRecords
index 9b15737..6484adf 100644 (file)
@@ -6,6 +6,10 @@
 
 #include <apt-pkg/macros.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 // A class representing a particular software provider.
 class __deprecated Vendor
 {
index 733d23a..4e05047 100644 (file)
 #include <vector>
 #include <apt-pkg/macros.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::vector;
+#endif
+
 class Vendor;
 class Configuration;
 
index 92dbc25..e0e0e6c 100644 (file)
 #include <apt-pkg/strutl.h>
 #include <string>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgVersioningSystem
 {
    public:
index da103fc..433396f 100644 (file)
 #include <string>
 #include <apt-pkg/pkgcache.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgVersionMatch
 {   
    // Version Matching