Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OB_FORMAT_H
00020 #define OB_FORMAT_H
00021 #include <openbabel/babelconfig.h>
00022 #include <openbabel/plugin.h>
00023 #include <typeinfo>
00024
00025 namespace OpenBabel
00026 {
00027 class OBBase;
00028 class OBConversion;
00029
00031 #define NOTREADABLE 0x01
00032 #define READONEONLY 0x02
00033 #define READBINARY 0x04
00034 #define ZEROATOMSOK 0x08
00035 #define NOTWRITABLE 0x10
00036 #define WRITEONEONLY 0x20
00037 #define WRITEBINARY 0x40
00038 #define READXML 0x80
00039 #define DEFAULTFORMAT 0x4000
00040
00042
00043 class OBCONV OBFormat : public OBPlugin
00044 {
00045
00046 MAKE_PLUGIN(OBFormat);
00047
00048 public:
00049
00051 OBFormat(){}
00052
00053 const char* TypeID(){ return "formats"; }
00054
00056
00060 virtual bool ReadMolecule(OBBase* , OBConversion* )
00061 { std::cerr << "HIER" << std::endl;
00062 std::cerr << "Not a valid input format"; return false;}
00063
00065
00069 virtual bool ReadChemObject(OBConversion* )
00070 { std::cerr << "Not a valid input format"; return false;}
00071
00073
00078 virtual bool WriteMolecule(OBBase* , OBConversion* )
00079 { std::cerr << "Not a valid output format"; return false;}
00080
00082
00086 virtual bool WriteChemObject(OBConversion* )
00087 { std::cerr << "Not a valid output format"; return false;}
00088
00090
00094 virtual const char* Description()=0;
00095
00097
00099 virtual const char* TargetClassDescription();
00100
00102
00105 virtual const std::type_info& GetType();
00106
00108 virtual const char* SpecificationURL() { return ""; }
00109
00111 virtual const char* GetMIMEType() { return pMime; }
00112
00114
00118 virtual unsigned int Flags() { return 0;};
00119
00121
00123 virtual int SkipObjects(int , OBConversion* )
00124 {
00125 return 0;
00126 };
00127
00129
00133 virtual OBFormat* MakeNewInstance()
00134 {
00135 return NULL;
00136 }
00137
00138
00139
00140 int RegisterFormat(const char* ID, const char* MIME = NULL);
00141
00146 virtual bool Display(std::string& txt, const char* param, const char* ID=NULL);
00147
00148 static OBFormat* FormatFromMIME(const char* MIME);
00149
00150 private:
00151 static PluginMapType &FormatsMIMEMap()
00152 {
00153 static PluginMapType m;
00154 return m;
00155 }
00156
00157 const char* pMime;
00158
00159
00160
00162
00163
00164
00166
00167
00168 };
00169
00170 }
00171 #endif
00172