]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-item.h
[ABI break] merged patch from Jonathan Thomas to have a new
[apt.git] / apt-pkg / acquire-item.h
index e6916a83454e2028d67ef8553464ae9d156f22ca..f39a90c0bfd7857d5ca0657b613d40441ec70740 100644 (file)
@@ -646,8 +646,9 @@ class pkgAcqIndexTrans : public pkgAcqIndex
 };
                                                                        /*}}}*/
 /** \brief Information about an index file. */                         /*{{{*/
-struct IndexTarget
+class IndexTarget
 {
+ public:
    /** \brief A URI from which the index file can be downloaded. */
    string URI;
 
@@ -662,14 +663,28 @@ struct IndexTarget
     */
    string MetaKey;
 
-   //FIXME: We should use virtual methods here instead…
-   bool IsOptional() const;
-   bool IsSubIndex() const;
+   virtual bool IsOptional() const {
+      return false;
+   }
+   virtual bool IsSubIndex() const {
+      return false;
+   }
 };
                                                                        /*}}}*/
 /** \brief Information about an optional index file. */                        /*{{{*/
-struct OptionalIndexTarget : public IndexTarget
+class OptionalIndexTarget : public IndexTarget
+{
+   virtual bool IsOptional() const {
+      return true;
+   }
+};
+                                                                       /*}}}*/
+/** \brief Information about an subindex index file. */                        /*{{{*/
+class SubIndexTarget : public IndexTarget
 {
+   virtual bool IsSubIndex() const {
+      return true;
+   }
 };
                                                                        /*}}}*/