OBMoleculeFormat Class Reference

An OBFormat convenience subclass for conversion to/from OBMol data. More...

#include <obmolecformat.h>

Inheritance diagram for OBMoleculeFormat:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 OBMoleculeFormat ()
virtual bool ReadChemObject (OBConversion *pConv)
 The "Convert" interface functions.
virtual bool WriteChemObject (OBConversion *pConv)
 The "Convert" interface Write function.
const std::type_info & GetType ()
 Returns the type of chemical object used by the format.
virtual bool ReadMolecule (OBBase *, OBConversion *)
 The "API" interface Read function.
virtual bool WriteMolecule (OBBase *, OBConversion *)
 The "API" interface Write function.
virtual const char * Description ()=0
 Information on this format. Printed out in response to -Hxxx option where xxx id the id of the format.
virtual const char * TargetClassDescription ()
 If not provided, the object type used by the default format is used (usually OBMol).
virtual const char * SpecificationURL ()
 Web address where the format is defined.
virtual const char * GetMIMEType ()
 Chemical MIME type associated with this file type (if any).
virtual unsigned int Flags ()
 Decribes the capabilities of the format (Read only etc.).
virtual int SkipObjects (int, OBConversion *)
 Returns 1 on success, -1 on error and 0 if not implemented.
virtual OBFormatMakeNewInstance ()
 Returns a pointer to a new instance of the format, or NULL if fails.

Detailed Description

An OBFormat convenience subclass for conversion to/from OBMol data.

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


Constructor & Destructor Documentation

OBMoleculeFormat (  )  [inline]


Member Function Documentation

virtual bool ReadChemObject ( OBConversion pConv  )  [inline, virtual]

The "Convert" interface functions.

Reimplemented from OBFormat.

virtual bool WriteChemObject ( OBConversion pConv  )  [inline, virtual]

The "Convert" interface Write function.

Writes a single object Deletes the object after writing Returns false on error

Reimplemented from OBFormat.

const std::type_info& GetType (  )  [inline, virtual]

Returns the type of chemical object used by the format.

Defaults to that used by the default format. Useful for checking that a format can handle a particular object.

Reimplemented from OBFormat.

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.

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. Returns false on error.

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

virtual int SkipObjects ( int  ,
OBConversion  
) [inline, virtual, inherited]

Returns 1 on success, -1 on error and 0 if not implemented.

virtual OBFormat* MakeNewInstance (  )  [inline, virtual, inherited]

Returns a pointer to a new instance of the format, or NULL if fails.

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.


The documentation for this class was generated from the following file: