#include <openbabel/obmolecformat.h>
Inheritance diagram for OBMoleculeFormat:
Public Types | |
typedef std::map< std::string, unsigned > | NameIndexType |
Public Member Functions | |
OBMoleculeFormat () | |
virtual bool | ReadChemObject (OBConversion *pConv) |
virtual bool | WriteChemObject (OBConversion *pConv) |
const std::type_info & | GetType () |
virtual bool | ReadMolecule (OBBase *, OBConversion *) |
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 int | SkipObjects (int, OBConversion *) |
virtual OBFormat * | MakeNewInstance () |
Static Public Member Functions | |
static bool | ReadChemObjectImpl (OBConversion *pConv, OBFormat *) |
static bool | WriteChemObjectImpl (OBConversion *pConv, OBFormat *) |
static bool | ReadNameIndex (NameIndexType &index, const std::string &datafilename, OBFormat *pInFormat) |
Routines to handle the -C option for combining data from several OBMols | |
static bool | DeferMolOutput (OBMol *pmol, OBConversion *pConv, OBFormat *pF) |
static bool | OutputDeferredMols (OBConversion *pConv) |
static bool | DeleteDeferredMols () |
static OBMol * | MakeCombinedMolecule (OBMol *pFirst, OBMol *pSecond) |
This class is not intended for direct use outside of Open Babel, unless you're writing a new format converting to or from an OBMol molecule. (e.g., see http://openbabel.sourceforge.net/wiki/HowTo:Add_A_New_File_Format).
An OBFormat which converts to and/or from OBMol can derive from this class to save duplicating the ReadChemObject() and/or WriteChemObject() methods. Derive directly from OBFormat if the object converted is not OBMol or if interaction with the framework is required during the execution of ReadMolecule() or WriteMolecule(), as for example in CMLFormat
typedef std::map<std::string, unsigned> NameIndexType |
OBMoleculeFormat | ( | ) | [inline] |
static bool ReadChemObjectImpl | ( | OBConversion * | pConv, | |
OBFormat * | ||||
) | [static] |
Static routine, which can be called from elsewhere.
static bool WriteChemObjectImpl | ( | OBConversion * | pConv, | |
OBFormat * | ||||
) | [static] |
Static routine, which can be called from elsewhere.
virtual bool ReadChemObject | ( | OBConversion * | pConv | ) | [inline, virtual] |
virtual bool WriteChemObject | ( | OBConversion * | pConv | ) | [inline, virtual] |
static bool DeferMolOutput | ( | OBMol * | pmol, | |
OBConversion * | pConv, | |||
OBFormat * | pF | |||
) | [static] |
Defer output of a molecule until later, so it can be combined with others
static bool OutputDeferredMols | ( | OBConversion * | pConv | ) | [static] |
Write out all molecules queued with DeferMolOutput.
static bool DeleteDeferredMols | ( | ) | [static] |
Delete the list of queued molecules from DeferMolOutput.
static bool ReadNameIndex | ( | NameIndexType & | index, | |
const std::string & | datafilename, | |||
OBFormat * | pInFormat | |||
) | [static] |
const std::type_info& GetType | ( | ) | [inline, virtual] |
virtual bool ReadMolecule | ( | OBBase * | , | |
OBConversion * | ||||
) | [inline, virtual, inherited] |
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 in XMLMoleculeFormat.
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.
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.
const char * TargetClassDescription | ( | ) | [virtual, inherited] |
If not provided, the object type used by the default format is used (usually OBMol).
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
virtual int SkipObjects | ( | int | , | |
OBConversion * | ||||
) | [inline, virtual, inherited] |
virtual OBFormat* MakeNewInstance | ( | ) | [inline, virtual, inherited] |
Normally a single global instance is used but this may cause problems if there are member variables and the format is used in more than one place in the program.