Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

SDFile Class Reference
[Molecular structure file formats]

MDL SD file class. More...

#include <SDFile.h>

Inheritance diagram for SDFile:

MOLFile GenericMolFile LineBasedFile File List of all members.

Public Member Functions

Constructors and Destructors
 SDFile () throw ()
 Default constructor.
 SDFile (const String &filename, File::OpenMode open_mode=std::ios::in) throw (Exception::FileNotFound)
 Detailed constructor.
 SDFile (const SDFile &file) throw (Exception::FileNotFound)
 Copy constructor.
virtual ~SDFile () throw ()
 Destructor.
Reading and Writing of Kernel Datastructures
virtual bool write (const System &system) throw (File::CannotWrite)
 Write a system to the SD file.
virtual bool write (const Molecule &molecule) throw (File::CannotWrite)
 Append a single molecule to the SD file.
virtual bool read (System &system) throw (Exception::ParseError)
 Read a system from the SD file.
virtual Moleculeread () throw (Exception::ParseError)
 Read a single molecule from an SD file.
void disableAtoms () throw ()
 Do not read atoms and bonds.
void enableAtoms () throw ()
 Read atoms and bonds.
const SDFileoperator= (const SDFile &file) throw ()

Protected Member Functions

void readPropertyBlock_ (Molecule &molecule)
 Read the property block of an SD file.
void writePropertyBlock_ (const Molecule &molecule)
 Read the propertyblock of an SD file.

Protected Attributes

bool read_atoms_
 Whether atoms and bonds should be read.

Detailed Description

MDL SD file class.

This class enables BALL to read and write MDL SD files.

A description of this file format (and the related MOLFile format) can be obtained from the MDL webpage http://www.mdli.com


Constructor & Destructor Documentation

SDFile::SDFile const String filename,
File::OpenMode  open_mode = std::ios::in
throw (Exception::FileNotFound)
 

Detailed constructor.


Member Function Documentation

void SDFile::disableAtoms  )  throw ()
 

Do not read atoms and bonds.

This (seemingly strange) option allows the user to read the properties of the molecules only. Since SD files can contain all kinds of information besides the molecular structure and reading the structure can be rather time and space consuming, you can disable it with this option. The read and write methods will still create molecules, but they will be empty. However, the NamedProperties of the molecules contain the optional information contained in the SD file.

void SDFile::enableAtoms  )  throw ()
 

Read atoms and bonds.

See also:
disableAtoms

virtual Molecule* SDFile::read  )  throw (Exception::ParseError) [virtual]
 

Read a single molecule from an SD file.

Reimplemented from MOLFile.

void SDFile::readPropertyBlock_ Molecule molecule  )  [protected]
 

Read the property block of an SD file.

The values are stored as named properties in the molecule read.

virtual bool SDFile::write const Molecule molecule  )  throw (File::CannotWrite) [virtual]
 

Append a single molecule to the SD file.

Reimplemented from MOLFile.

virtual bool SDFile::write const System system  )  throw (File::CannotWrite) [virtual]
 

Write a system to the SD file.

Write all molecules contained in the system to the SD file. All named properties are included in the property section.

Reimplemented from MOLFile.

void SDFile::writePropertyBlock_ const Molecule molecule  )  [protected]
 

Read the propertyblock of an SD file.

The values are stored as named properties in the molecule read.