X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/17caf1b19355813fa7a58828d4979ecf21b1e1f9..bebdca4bf63ae661c60bc1e0f4e03e6bbb7a7cc5:/apt-pkg/acquire-item.h diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index fd01bbb9a..3079c68ef 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire-item.h,v 1.16 1999/02/01 02:22:11 jgg Exp $ +// $Id: acquire-item.h,v 1.19 1999/04/11 21:23:09 jgg Exp $ /* ###################################################################### Acquire Item - Item to acquire @@ -48,6 +48,7 @@ class pkgAcquire::Item enum {StatIdle, StatFetching, StatDone, StatError} Status; string ErrorText; unsigned long FileSize; + unsigned long PartialSize; char *Mode; unsigned long ID; bool Complete; @@ -64,10 +65,10 @@ class pkgAcquire::Item virtual void Done(string Message,unsigned long Size,string Md5Hash); virtual void Start(string Message,unsigned long Size); virtual string Custom600Headers() {return string();}; + virtual string DescURI() = 0; // Inquire functions virtual string MD5Sum() {return string();}; - virtual string Describe() = 0; Item(pkgAcquire *Owner); virtual ~Item(); @@ -88,7 +89,7 @@ class pkgAcqIndex : public pkgAcquire::Item // Specialized action members virtual void Done(string Message,unsigned long Size,string Md5Hash); virtual string Custom600Headers(); - virtual string Describe(); + virtual string DescURI() {return Location->PackagesURI();}; pkgAcqIndex(pkgAcquire *Owner,const pkgSourceList::Item *Location); }; @@ -107,7 +108,7 @@ class pkgAcqIndexRel : public pkgAcquire::Item virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); virtual void Done(string Message,unsigned long Size,string Md5Hash); virtual string Custom600Headers(); - virtual string Describe(); + virtual string DescURI() {return Location->ReleaseURI();}; pkgAcqIndexRel(pkgAcquire *Owner,const pkgSourceList::Item *Location); }; @@ -135,12 +136,29 @@ class pkgAcqArchive : public pkgAcquire::Item // Specialized action members virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); virtual void Done(string Message,unsigned long Size,string Md5Hash); - virtual string Describe(); virtual string MD5Sum() {return MD5;}; + virtual string DescURI() {return Desc.URI;}; pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources, pkgRecords *Recs,pkgCache::VerIterator const &Version, string &StoreFilename); }; +// Fetch a generic file to the current directory +class pkgAcqFile : public pkgAcquire::Item +{ + pkgAcquire::ItemDesc Desc; + string MD5; + + public: + + // Specialized action members + virtual void Done(string Message,unsigned long Size,string Md5Hash); + virtual string MD5Sum() {return MD5;}; + virtual string DescURI() {return Desc.URI;}; + + pkgAcqFile(pkgAcquire *Owner,string URI,string MD5,unsigned long Size, + string Desc,string ShortDesc); +}; + #endif