Abstract class for XML formats which represent molecules. More...
#include <openbabel/xml.h>
Public Types | |
typedef std::map< const char *, OBPlugin *, CharPtrLess > | PluginMapType |
typedef PluginMapType::const_iterator | PluginIterator |
Public Member Functions | |
~XMLMoleculeFormat () | |
virtual bool | ReadChemObject (OBConversion *pConv) |
virtual bool | WriteChemObject (OBConversion *pConv) |
virtual bool | ReadMolecule (OBBase *pOb, OBConversion *pConv) |
const std::type_info & | GetType () |
virtual const char * | NamespaceURI () const =0 |
virtual bool | DoElement (const std::string &ElName) |
virtual bool | EndElement (const std::string &ElName) |
virtual const char * | EndTag () |
const char * | TypeID () |
virtual bool | WriteMolecule (OBBase *, OBConversion *) |
virtual const char * | Description ()=0 |
virtual const char * | TargetClassDescription () |
virtual const char * | SpecificationURL () |
virtual const char * | GetMIMEType () |
virtual unsigned int | Flags () |
virtual OBFormat * | MakeNewInstance () |
int | RegisterFormat (const char *ID, const char *MIME=NULL) |
virtual bool | Display (std::string &txt, const char *param, const char *ID=NULL) |
virtual OBPlugin * | MakeInstance (const std::vector< std::string > &) |
virtual void | Init () |
const char * | GetID () const |
virtual PluginMapType & | GetMap () const =0 |
Static Public Member Functions | |
static OBFormat * | FormatFromMIME (const char *MIME) |
static OBPlugin * | GetPlugin (const char *Type, const char *ID) |
static bool | ListAsVector (const char *PluginID, const char *param, std::vector< std::string > &vlist) |
static void | List (const char *PluginID, const char *param=NULL, std::ostream *os=&std::cout) |
static std::string | ListAsString (const char *PluginID, const char *param=NULL) |
static std::string | FirstLine (const char *txt) |
static PluginIterator | Begin (const char *PluginID) |
static PluginIterator | End (const char *PluginID) |
Protected Member Functions | |
xmlTextReaderPtr | reader () const |
xmlTextWriterPtr | writer () const |
void | OutputToStream () |
virtual int | SkipObjects (int n, OBConversion *pConv) |
Static Protected Member Functions | |
static PluginMapType & | PluginMap () |
static PluginMapType & | GetTypeMap (const char *PluginID) |
static OBPlugin * | BaseFindType (PluginMapType &Map, const char *ID) |
Protected Attributes | |
OBMol * | _pmol |
XMLConversion * | _pxmlConv |
std::string | _prefix |
int | baseindent |
int | ind |
std::string | nsdecl |
int | _embedlevel |
const char * | _id |
Abstract class for XML formats which represent molecules.
typedef std::map<const char*, OBPlugin*, CharPtrLess> PluginMapType [inherited] |
~XMLMoleculeFormat | ( | ) | [inline] |
virtual bool ReadChemObject | ( | OBConversion * | ) | [inline, virtual] |
The "Convert" interface Read function.
Possibly reads multiple new objects on the heap and subjects them to its DoTransformations() function, which may delete them again. Sends result to pConv->AddChemObject()
Reimplemented from OBFormat.
virtual bool WriteChemObject | ( | OBConversion * | ) | [inline, virtual] |
The "Convert" interface Write function.
Writes a single object Deletes the object after writing
Reimplemented from OBFormat.
virtual bool ReadMolecule | ( | OBBase * | , |
OBConversion * | |||
) | [inline, virtual] |
The "API" interface Read function.
Reads a single object. Does not make a new object on the heap; can be used with a pointer to an chem object on the heap or the stack.
Reimplemented from OBFormat.
const std::type_info& GetType | ( | void | ) | [inline, virtual] |
Reimplemented from OBFormat.
virtual const char* NamespaceURI | ( | ) | const [pure virtual, inherited] |
virtual bool DoElement | ( | const std::string & | ElName ) | [inline, virtual, inherited] |
virtual bool EndElement | ( | const std::string & | ElName ) | [inline, virtual, inherited] |
virtual const char* EndTag | ( | ) | [inline, virtual, inherited] |
The tag at the end of the chemical object e.g. "/molecule>".
Referenced by XMLBaseFormat::SkipObjects().
xmlTextReaderPtr reader | ( | ) | const [inline, protected, inherited] |
xmlTextWriterPtr writer | ( | ) | const [inline, protected, inherited] |
void OutputToStream | ( | ) | [inline, protected, inherited] |
virtual int SkipObjects | ( | int | n, |
OBConversion * | pConv | ||
) | [inline, protected, virtual, inherited] |
Skip past first n objects in input stream (or current one with n=0) Returns 1 on success, -1 on error and 0 if not implemented
Reimplemented from OBFormat.
const char* TypeID | ( | ) | [inline, virtual, inherited] |
Redefined by each plugin type: "formats", "fingerprints", etc.
Reimplemented from OBPlugin.
virtual bool WriteMolecule | ( | OBBase * | , |
OBConversion * | |||
) | [inline, virtual, inherited] |
The "API" interface Write function.
Writes a single object Does not delete the object; can be used with a pointer to an chem object on the heap or the stack.
Referenced by OBMoleculeFormat::DoOutputOptions(), OBMoleculeFormat::OutputDeferredMols(), OBConversion::Write(), and OBMoleculeFormat::WriteChemObjectImpl().
virtual const char* Description | ( | ) | [pure virtual, inherited] |
Information on this format. Printed out in response to -Hxxx option where xxx id the id of the format.
Must be provided by each format class. Can include a list of command line Options. These may be used to construction check boxes, radio buttons etc for GUI interface.
Reimplemented from OBPlugin.
Referenced by OBConversion::GetNextFormat(), OBMoleculeFormat::ReadChemObjectImpl(), OBConversion::RegisterOptionParam(), and OBMoleculeFormat::WriteChemObjectImpl().
const char * TargetClassDescription | ( | ) | [virtual, inherited] |
A decription of the chemical object converted by this format.
If not provided, the object type used by the default format is used (usually OBMol).
Referenced by OBConversion::ReportNumberConverted().
virtual const char* SpecificationURL | ( | ) | [inline, virtual, inherited] |
Web address where the format is defined.
virtual const char* GetMIMEType | ( | ) | [inline, virtual, inherited] |
Chemical MIME type associated with this file type (if any)
virtual unsigned int Flags | ( | ) | [inline, virtual, inherited] |
Decribes the capabilities of the format (Read only etc.)
Currently, can be a bitwise OR of any of the following NOTREADABLE READONEONLY NOTWRITABLE WRITEONEONLY DEFAULTFORMAT READBINARY WRITEBINARY READXML
Referenced by OBConversion::AddChemObject(), OBConversion::Convert(), OBConversion::FullConvert(), OBConversion::GetNextFormat(), OBConversion::InstallStreamFilter(), OBConversion::OpenAndSetFormat(), OBMoleculeFormat::ReadChemObjectImpl(), OBConversion::ReadFile(), OBConversion::SetInFormat(), OBConversion::SetOutFormat(), and OBConversion::WriteFile().
virtual OBFormat* MakeNewInstance | ( | ) | [inline, virtual, inherited] |
int RegisterFormat | ( | const char * | ID, |
const char * | MIME = NULL |
||
) | [inherited] |
Referenced by OBConversion::RegisterFormat().
bool Display | ( | std::string & | txt, |
const char * | param, | ||
const char * | ID = NULL |
||
) | [virtual, inherited] |
Provides a description in txt of the format specified by itr. If param starts with "in", "read", "out" or "write" only the appropriate formats are output. The others return false. If param contains "verbose", the whole description is output.
Reimplemented from OBPlugin.
OBFormat * FormatFromMIME | ( | const char * | MIME ) | [static, inherited] |
Referenced by XMLMoleculeFormat::ReadMolecule().
XMLConversion* _pxmlConv [protected, inherited] |
std::string _prefix [protected, inherited] |
int baseindent [protected, inherited] |
int ind [protected, inherited] |
std::string nsdecl [protected, inherited] |
int _embedlevel [protected, inherited] |
Referenced by XMLMoleculeFormat::ReadMolecule().