rawfilefactory.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __RAWFILEFACTORY_H
00024 #define __RAWFILEFACTORY_H
00025
00026
00027 #include <string>
00028 #include <map>
00029 #include <boost/function.hpp>
00030
00031 #include <libopenraw++/rawfile.h>
00032
00033 namespace OpenRaw {
00034 namespace Internals {
00035
00036 class RawFileFactory
00037 {
00038 public:
00039 typedef boost::function<RawFile *(IO::Stream *)> raw_file_factory_t;
00043 typedef
00044 std::map<RawFile::Type, raw_file_factory_t> Table;
00045 typedef
00046 std::map<std::string, RawFile::Type> Extensions;
00047
00055 RawFileFactory(RawFile::Type type,
00056 const raw_file_factory_t & fn,
00057 const char * ext);
00058
00060 static Table & table();
00062 static Extensions & extensions();
00063
00065 static const char **fileExtensions();
00066
00067 static void registerType(RawFile::Type type,
00068 const raw_file_factory_t & fn,
00069 const char * ext);
00070 static void unRegisterType(RawFile::Type type);
00071 };
00072
00073
00074
00078 inline RawFileFactory::Table & RawFileFactory::table()
00079 {
00081 static Table rawFactoryTable;
00082 return rawFactoryTable;
00083 }
00084
00085 inline RawFileFactory::Extensions & RawFileFactory::extensions()
00086 {
00088 static Extensions rawExtensionsTable;
00089 return rawExtensionsTable;
00090 }
00091
00092
00093 }
00094 }
00095
00096 #endif
00097
00098
00099
00100
00101
00102
00103
00104
00105