00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef HxImgFileIoTable_h
00011 #define HxImgFileIoTable_h
00012
00013
00014 #include "HxStd.h"
00015 #include "HxString.h"
00016 #include <map>
00017
00018 #pragma warning(disable: 4251)
00019
00020 class HxImgFileReader;
00021 class HxImgFileWriter;
00022
00023 class L_HXIMAGEREP HxImgFileIoTable {
00024
00025 public:
00026
00027 ~HxImgFileIoTable();
00028 static HxImgFileIoTable& instance();
00029
00030 HxImgFileReader* getReader(HxString suffix) const;
00031 HxImgFileWriter* getWriter(HxString suffix) const;
00032
00033 void registerReader(
00034 HxString suffix,
00035 HxImgFileReader* reader);
00036
00037 void registerWriter(
00038 HxString suffix,
00039 HxImgFileWriter* writer);
00040
00041 private:
00042
00043 HxImgFileIoTable();
00044 HxImgFileIoTable(const HxImgFileIoTable&);
00045 HxImgFileIoTable& operator=(const HxImgFileIoTable&);
00046
00047 typedef HxImgFileReader* ReaderPtr;
00048 typedef HxImgFileWriter* WriterPtr;
00049
00050 typedef std::map<
00051 HxString, ReaderPtr,
00052 std::less<HxString> > ReaderTable;
00053 typedef std::map<
00054 HxString, WriterPtr,
00055 std::less<HxString> > WriterTable;
00056
00057 #pragma warning(disable: 4786)
00058 ReaderTable _readerTable;
00059 WriterTable _writerTable;
00060 };
00061
00062 #pragma warning(default: 4251)
00063
00064 #endif