20 #ifndef OST_IO_MAP_IO_PLUGIN_H
21 #define OST_IO_MAP_IO_PLUGIN_H
23 #include <boost/shared_ptr.hpp>
24 #include <boost/filesystem/operations.hpp>
26 #include <ost/img/map.hh>
27 #include <ost/img/alg/normalizer.hh>
31 namespace ost {
namespace io {
36 virtual void Import(img::MapHandle& surf,
const boost::filesystem::path& loc,
const ImageFormatBase& formatstruct) = 0;
37 virtual void Import(img::MapHandle& surf, std::istream& stream,
const ImageFormatBase& formatstruct) = 0;
38 virtual void Export(
const img::MapHandle& ent,
const boost::filesystem::path& loc,
const ImageFormatBase& formatstruct)
const = 0;
39 virtual void Export(
const img::MapHandle& ent, std::ostream& stream,
const ImageFormatBase& formatstruct)
const = 0;
47 virtual bool MatchContent(
unsigned char* header)
const = 0;
49 virtual bool MatchSuffix(
const String& loc)
const =0 ;
51 virtual String GetFormatName()
const =0;
52 virtual String GetFormatDescription()
const =0;
58 template <
class HANDLER>
62 virtual bool MatchContent(
unsigned char* header)
const {
63 return HANDLER::MatchContent(header);
67 return HANDLER::MatchType(type);
70 virtual bool MatchSuffix(
const String& loc)
const {
71 return HANDLER::MatchSuffix(loc);
74 virtual String GetFormatName()
const {
75 return HANDLER::GetFormatName();
78 virtual String GetFormatDescription()
const {
79 return HANDLER::GetFormatDescription();