00001
00009 #ifndef CIMAGE_H
00010 #define CIMAGE_H
00011
00012 #include <string>
00013 #include <set>
00014 #include <list>
00015 #include <fstream>
00016 #include <stdexcept>
00017
00021 class CImage
00022 {
00023 public:
00027 class ImageError : public std::logic_error {
00028 public:
00029 ImageError(const std::string& what)
00030 : std::logic_error(what)
00031 {}
00032 };
00033
00036 virtual ~CImage()
00037 {};
00038
00042 virtual int read(std::ifstream& in) = 0;
00043 virtual int write(std::ofstream& out) = 0;
00044 virtual int callFunc(std::string func, std::list<std::string> params) = 0;
00045
00049 bool supportsType(std::string type)
00050 {
00051 return (m_types.find(type) == m_types.end()) ? false : true;
00052 }
00053
00054 protected:
00055 std::set<std::string> m_types;
00056 };
00057
00058 #endif
00059
00060