acquire-item.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: acquire-item.h,v 1.2 1998/10/22 04:56:39 jgg Exp $
  4. /* ######################################################################
  5. Acquire Item - Item to acquire
  6. When an item is instantiated it will add it self to the local list in
  7. the Owner Acquire class. Derived classes will then call QueueURI to
  8. register all the URI's they wish to fetch for at the initial moment.
  9. Two item classes are provided to provide functionality for downloading
  10. of Index files and downloading of Packages.
  11. ##################################################################### */
  12. /*}}}*/
  13. #ifndef PKGLIB_ACQUIRE_ITEM_H
  14. #define PKGLIB_ACQUIRE_ITEM_H
  15. #include <apt-pkg/acquire.h>
  16. #include <apt-pkg/sourcelist.h>
  17. #ifdef __GNUG__
  18. #pragma interface "apt-pkg/acquire-item.h"
  19. #endif
  20. // Item to acquire
  21. class pkgAcquire::Item
  22. {
  23. protected:
  24. pkgAcquire *Owner;
  25. inline void QueueURI(string URI,string Description)
  26. {Owner->Enqueue(this,URI,Description);};
  27. public:
  28. // Number of queues we are inserted into
  29. unsigned int QueueCounter;
  30. // File to write the fetch into
  31. string DestFile;
  32. virtual void Failed() {};
  33. virtual string Custom600Headers() {return string();};
  34. Item(pkgAcquire *Owner);
  35. virtual ~Item();
  36. };
  37. // Item class for index files
  38. class pkgAcqIndex : public pkgAcquire::Item
  39. {
  40. protected:
  41. const pkgSourceList::Item *Location;
  42. public:
  43. virtual string Custom600Headers();
  44. pkgAcqIndex(pkgAcquire *Owner,const pkgSourceList::Item *Location);
  45. };
  46. // Item class for index files
  47. class pkgAcqIndexRel : public pkgAcquire::Item
  48. {
  49. protected:
  50. const pkgSourceList::Item *Location;
  51. public:
  52. virtual string Custom600Headers();
  53. pkgAcqIndexRel(pkgAcquire *Owner,const pkgSourceList::Item *Location);
  54. };
  55. #endif