]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/collectionsource.h
Add a virtual destructor to CollectionSource
[libs/datafile.git] / source / collectionsource.h
index 61bb11555decbbf85d36500f18ed829073b64f31..90c36f2fce009768874c42b56c21fbf29d11457d 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <list>
 #include <string>
+#include <msp/io/seekable.h>
 
 namespace Msp {
 namespace DataFile {
@@ -21,8 +22,9 @@ public:
 
 protected:
        CollectionSource() { }
-
 public:
+       virtual ~CollectionSource() { }
+
        /** Determines */
        virtual bool is_loadable(const CollectionItemTypeBase &type, const std::string &name) const = 0;
 
@@ -31,6 +33,10 @@ public:
        virtual NameList get_names(const CollectionItemTypeBase &type) const = 0;
 
        virtual void load(Collection &, const CollectionItemTypeBase &, const std::string &) const = 0;
+
+       /** Opens a file from the source.  The caller is responsible for deleting
+       the returned object when done with it. */
+       virtual IO::Seekable *open(const std::string &) const = 0;
 };
 
 } // namespace DataFile