From f2e4a11df4ee4a67018421ca6c208009a590366b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 28 Jul 2011 09:50:51 +0200 Subject: * apt-pkg/cdrom.{cc,h}: - cleanup old ABI break avoidance hacks --- apt-pkg/cdrom.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'apt-pkg/cdrom.h') diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h index e83c38582..614062cbb 100644 --- a/apt-pkg/cdrom.h +++ b/apt-pkg/cdrom.h @@ -92,9 +92,7 @@ class pkgUdevCdromDevices /*{{{*/ struct udev_enumerate *(*udev_enumerate_new) (struct udev *udev); struct udev_list_entry *(*udev_list_entry_get_next)(struct udev_list_entry *list_entry); const char* (*udev_device_get_property_value)(struct udev_device *udev_device, const char *key); -#if 0 // FIXME: uncomment on next ABI break int (*udev_enumerate_add_match_sysattr)(struct udev_enumerate *udev_enumerate, const char *property, const char *value); -#endif // end libudev dlopen public: @@ -104,11 +102,11 @@ class pkgUdevCdromDevices /*{{{*/ // try to open bool Dlopen(); - // this is the new interface - vector ScanForRemovable(bool CdromOnly); - // FIXME: compat with the old interface/API/ABI only + // convenience interface, this will just call ScanForRemovable + // with "APT::cdrom::CdromOnly" vector Scan(); + vector ScanForRemovable(bool CdromOnly); }; /*}}}*/ -- cgit v1.2.3 From 8f3ba4e8708cb72be19dacc2af4f601ee5fea292 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 19 Sep 2011 13:31:29 +0200 Subject: do not pollute namespace in the headers with using (Closes: #500198) --- apt-pkg/cdrom.h | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'apt-pkg/cdrom.h') diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h index 614062cbb..2241f1eba 100644 --- a/apt-pkg/cdrom.h +++ b/apt-pkg/cdrom.h @@ -6,8 +6,6 @@ #include -using namespace std; - class pkgCdromStatus /*{{{*/ { protected: @@ -20,12 +18,12 @@ class pkgCdromStatus /*{{{*/ // total steps virtual void SetTotal(int total) { totalSteps = total; }; // update steps, will be called regularly as a "pulse" - virtual void Update(string text="", int current=0) = 0; + virtual void Update(std::string text="", int current=0) = 0; // ask for cdrom insert virtual bool ChangeCdrom() = 0; // ask for cdrom name - virtual bool AskCdromName(string &Name) = 0; + virtual bool AskCdromName(std::string &Name) = 0; // Progress indicator for the Index rewriter virtual OpProgress* GetOpProgress() {return NULL; }; }; @@ -47,22 +45,22 @@ class pkgCdrom /*{{{*/ }; - bool FindPackages(string CD, - vector &List, - vector &SList, - vector &SigList, - vector &TransList, - string &InfoDir, pkgCdromStatus *log, + bool FindPackages(std::string CD, + std::vector &List, + std::vector &SList, + std::vector &SigList, + std::vector &TransList, + std::string &InfoDir, pkgCdromStatus *log, unsigned int Depth = 0); - bool DropBinaryArch(vector &List); - bool DropRepeats(vector &List,const char *Name); - void ReduceSourcelist(string CD,vector &List); + bool DropBinaryArch(std::vector &List); + bool DropRepeats(std::vector &List,const char *Name); + void ReduceSourcelist(std::string CD,std::vector &List); bool WriteDatabase(Configuration &Cnf); - bool WriteSourceList(string Name,vector &List,bool Source); - int Score(string Path); + bool WriteSourceList(std::string Name,std::vector &List,bool Source); + int Score(std::string Path); public: - bool Ident(string &ident, pkgCdromStatus *log); + bool Ident(std::string &ident, pkgCdromStatus *log); bool Add(pkgCdromStatus *log); }; /*}}}*/ @@ -71,9 +69,9 @@ class pkgCdrom /*{{{*/ // class that uses libudev to find cdrom/removable devices dynamically struct CdromDevice /*{{{*/ { - string DeviceName; + std::string DeviceName; bool Mounted; - string MountPath; + std::string MountPath; }; /*}}}*/ class pkgUdevCdromDevices /*{{{*/ @@ -104,9 +102,9 @@ class pkgUdevCdromDevices /*{{{*/ // convenience interface, this will just call ScanForRemovable // with "APT::cdrom::CdromOnly" - vector Scan(); + std::vector Scan(); - vector ScanForRemovable(bool CdromOnly); + std::vector ScanForRemovable(bool CdromOnly); }; /*}}}*/ -- cgit v1.2.3 From 472ff00ef2e48383805d281c6364ec27839e3f4d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 19 Sep 2011 19:14:19 +0200 Subject: use forward declaration in headers if possible instead of includes --- apt-pkg/cdrom.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apt-pkg/cdrom.h') 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 #include #include +class Configuration; +class OpProgress; class pkgCdromStatus /*{{{*/ { -- cgit v1.2.3 From a4f6bdc8bd91c7282ae9ac60c44844c6f0058a65 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Dec 2011 00:54:37 +0100 Subject: revert 2184.1.2: do not pollute namespace in headers The breakage is just to big for now, so guard the change with #ifndef APT_8_CLEANER_HEADERS and be nice to library users --- apt-pkg/cdrom.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apt-pkg/cdrom.h') diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h index 319254fd0..4fcf5abcd 100644 --- a/apt-pkg/cdrom.h +++ b/apt-pkg/cdrom.h @@ -4,6 +4,10 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using namespace std; +#endif + class Configuration; class OpProgress; -- cgit v1.2.3 From b9dadc24b9477b466bc8058c765d76c65ecc7125 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Dec 2011 01:22:38 +0100 Subject: revert 2184.1.3: forward declaration instead of headers The breakage is just to big for now, so guard the change with #ifndef APT_8_CLEANER_HEADERS and be nice to library users --- apt-pkg/cdrom.h | 1 + 1 file changed, 1 insertion(+) (limited to 'apt-pkg/cdrom.h') diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h index 4fcf5abcd..cedfccff7 100644 --- a/apt-pkg/cdrom.h +++ b/apt-pkg/cdrom.h @@ -5,6 +5,7 @@ #include #ifndef APT_8_CLEANER_HEADERS +#include using namespace std; #endif -- cgit v1.2.3