summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.h
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:51:04 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:51:04 +0000
commit0118833a3b3e65ad7296863aa7d49574eb615f83 (patch)
treebbeac95408b7a84a983cc602dae3b315ed9976d9 /apt-pkg/acquire-item.h
parent7b0229fe01e9b300e1a67d82f7a6511c31444756 (diff)
Devel acquire module
Author: jgg Date: 1998-10-15 06:59:59 GMT Devel acquire module
Diffstat (limited to 'apt-pkg/acquire-item.h')
-rw-r--r--apt-pkg/acquire-item.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
new file mode 100644
index 000000000..6ab8859e4
--- /dev/null
+++ b/apt-pkg/acquire-item.h
@@ -0,0 +1,76 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/
+// $Id: acquire-item.h,v 1.1 1998/10/15 06:59:59 jgg Exp $
+/* ######################################################################
+
+ Acquire Item - Item to acquire
+
+ When an item is instantiated it will add it self to the local list in
+ the Owner Acquire class. Derived classes will then call QueueURI to
+ register all the URI's they wish to fetch for at the initial moment.
+
+ Two item classes are provided to provide functionality for downloading
+ of Index files and downloading of Packages.
+
+ ##################################################################### */
+ /*}}}*/
+#ifndef PKGLIB_ACQUIRE_ITEM_H
+#define PKGLIB_ACQUIRE_ITEM_H
+
+#include <apt-pkg/acquire.h>
+#include <apt-pkg/sourcelist.h>
+
+#ifdef __GNUG__
+#pragma interface "apt-pkg/acquire-item.h"
+#endif
+
+// Item to acquire
+class pkgAcquire::Item
+{
+ protected:
+
+ pkgAcquire *Owner;
+ inline void QueueURI(string URI) {Owner->Enqueue(this,URI);};
+
+ public:
+
+ unsigned int QueueCounter;
+ string Description;
+
+ virtual string ToFile() = 0;
+ virtual void Failed() {};
+
+ Item(pkgAcquire *Owner);
+ virtual ~Item();
+};
+
+// Item class for index files
+class pkgAcqIndex : public pkgAcquire::Item
+{
+ protected:
+
+ const pkgSourceList::Item *Location;
+
+ public:
+
+ virtual string ToFile();
+
+ pkgAcqIndex(pkgAcquire *Owner,const pkgSourceList::Item *Location);
+};
+
+// Item class for index files
+class pkgAcqIndexRel : public pkgAcquire::Item
+{
+ protected:
+
+ const pkgSourceList::Item *Location;
+
+ public:
+
+ virtual string ToFile();
+
+ pkgAcqIndexRel(pkgAcquire *Owner,const pkgSourceList::Item *Location);
+};
+
+
+#endif