imgsynth2/cfile.h

00001 
00009 #ifndef CFILE_H
00010 #define CFILE_H
00011 
00012 #include <string>
00013 #include <set>
00014 #include <list>
00015 #include <fstream>
00016 #include <stdexcept>
00017 
00029 class CFile
00030 {
00031   public:
00036     class FileError : public std::invalid_argument {
00037       public:
00047         FileError(const std::string& what)
00048           : std::invalid_argument(what)
00049         {}
00050     };
00051 
00061     virtual ~CFile()
00062     {};
00063 
00073     virtual void read(std::ifstream& in) = 0;
00074 
00084     virtual void write(std::ofstream& out) = 0;
00085 
00097     virtual void callFunc(const std::string& func, const std::list<std::string>& params) = 0;
00098 
00108     bool supportsType(const std::string& type)
00109     {
00110       return (m_types.find(type) == m_types.end()) ? false : true;
00111     }
00112 
00113   protected:
00114     /* members */
00116     std::set<std::string> m_types;
00117 };
00118 
00119 #endif
00120 
00121 /* vim: set et sw=2 ts=2: */

Generated on Sat May 2 18:58:11 2009 for imgsynth2 by  doxygen 1.5.3