home *** CD-ROM | disk | FTP | other *** search
-
- // abstract.h.loader
-
- // Dreamscape - C++ class library for RISC OS
- // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
- //
- // This library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Library General Public
- // License as published by the Free Software Foundation; either
- // version 2 of the License, or (at your option) any later version.
- // See the Dreamscape documentation for more information.
-
- #ifndef dreamscape_loader_H
- #define dreamscape_loader_H
-
- #include "filetype.h"
-
- class istream;
-
- template <class Data, class Info>
- class Loader {
- public:
- virtual bool accept(const Info &info) const = 0;
- virtual void load(const Info &info, Data data) = 0;
- };
-
- template <class Data, class Info>
- class LoaderOneType: public Loader<Data, Info> {
- Filetype t;
- public:
- LoaderOneType(Filetype type): t(type) {}
-
- bool accept(const Info &info) const { return info.type == t; }
-
- void set_filetype(Filetype type) { t = type; }
- Filetype get_filetype() const { return t; }
- };
-
- #endif
-