X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/e70c1d067335bfa686fa0c6e75e32afb095e1aaa..533fe3d13927798c17bdef84eba60ed9441d9608:/apt-pkg/indexcopy.h diff --git a/apt-pkg/indexcopy.h b/apt-pkg/indexcopy.h index e3de1afd9..729b0c8cb 100644 --- a/apt-pkg/indexcopy.h +++ b/apt-pkg/indexcopy.h @@ -14,15 +14,21 @@ #include #include +#include + +#ifndef APT_10_CLEANER_HEADERS +#include +class FileFd; +#endif #ifndef APT_8_CLEANER_HEADERS using std::string; using std::vector; #endif class pkgTagSection; -class FileFd; class indexRecords; class pkgCdromStatus; +class FileFd; class IndexCopy /*{{{*/ { @@ -40,7 +46,7 @@ class IndexCopy /*{{{*/ void ConvertToSourceList(std::string CD,std::string &Path); bool GrabFirst(std::string Path,std::string &To,unsigned int Depth); virtual bool GetFile(std::string &Filename,unsigned long long &Size) = 0; - virtual bool RewriteEntry(FILE *Target,std::string File) = 0; + virtual bool RewriteEntry(FileFd &Target, std::string const &File) = 0; virtual const char *GetFileName() = 0; virtual const char *Type() = 0; @@ -48,7 +54,7 @@ class IndexCopy /*{{{*/ bool CopyPackages(std::string CDROM,std::string Name,std::vector &List, pkgCdromStatus *log); - virtual ~IndexCopy() {}; + virtual ~IndexCopy(); }; /*}}}*/ class PackageCopy : public IndexCopy /*{{{*/ @@ -56,7 +62,7 @@ class PackageCopy : public IndexCopy /*{{{*/ protected: virtual bool GetFile(std::string &Filename,unsigned long long &Size); - virtual bool RewriteEntry(FILE *Target,std::string File); + virtual bool RewriteEntry(FileFd &Target, std::string const &File); virtual const char *GetFileName() {return "Packages";}; virtual const char *Type() {return "Package";}; @@ -67,7 +73,7 @@ class SourceCopy : public IndexCopy /*{{{*/ protected: virtual bool GetFile(std::string &Filename,unsigned long long &Size); - virtual bool RewriteEntry(FILE *Target,std::string File); + virtual bool RewriteEntry(FileFd &Target, std::string const &File); virtual const char *GetFileName() {return "Sources";}; virtual const char *Type() {return "Source";}; @@ -88,22 +94,18 @@ class SigVerify /*{{{*/ /** \brief dpointer placeholder (for later in case we need it) */ void *d; - bool Verify(std::string prefix,std::string file, indexRecords *records); - bool CopyMetaIndex(std::string CDROM, std::string CDName, + APT_HIDDEN bool Verify(std::string prefix,std::string file, indexRecords *records); + APT_HIDDEN bool CopyMetaIndex(std::string CDROM, std::string CDName, std::string prefix, std::string file); public: bool CopyAndVerify(std::string CDROM,std::string Name,std::vector &SigList, std::vector PkgList,std::vector SrcList); - /** \brief generates and run the command to verify a file with gpgv */ - static bool RunGPGV(std::string const &File, std::string const &FileOut, + APT_DEPRECATED static bool RunGPGV(std::string const &File, std::string const &FileOut, int const &statusfd, int fd[2]); - inline static bool RunGPGV(std::string const &File, std::string const &FileOut, - int const &statusfd = -1) { - int fd[2]; - return RunGPGV(File, FileOut, statusfd, fd); - }; + APT_DEPRECATED static bool RunGPGV(std::string const &File, std::string const &FileOut, + int const &statusfd = -1); }; /*}}}*/