BALL::SDFile Class Reference
[Molecular structure file formats]

#include <BALL/FORMAT/SDFile.h>

Inheritance diagram for BALL::SDFile:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Constructors and Destructors

 SDFile ()
 SDFile (const String &filename, File::OpenMode open_mode=std::ios::in)
virtual ~SDFile ()
 Destructor.
Reading and Writing of Kernel Datastructures

virtual bool write (const System &system)
virtual bool write (const Molecule &molecule)
virtual bool read (System &system)
virtual Moleculeread ()
void disableAtoms ()
void enableAtoms ()
const SDFileoperator= (const SDFile &file)

Protected Member Functions

void readPropertyBlock_ (Molecule &molecule)
void writePropertyBlock_ (const Molecule &molecule)

Protected Attributes

bool read_atoms_

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

Definition at line 22 of file SDFile.h.


Constructor & Destructor Documentation

BALL::SDFile::SDFile (  ) 

Default constructor

BALL::SDFile::SDFile ( const String filename,
File::OpenMode  open_mode = std::ios::in 
)

Detailed constructor.

Exceptions:
Exception::FileNotFound if the file could not be opened
virtual BALL::SDFile::~SDFile (  )  [virtual]

Destructor.


Member Function Documentation

void BALL::SDFile::disableAtoms (  ) 

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 BALL::SDFile::enableAtoms (  ) 

Read atoms and bonds.

See also:
disableAtoms
const SDFile& BALL::SDFile::operator= ( const SDFile file  ) 
virtual Molecule* BALL::SDFile::read (  )  [virtual]

Read a single molecule from an SD file.

Exceptions:
Exception::ParseError if a syntax error was encountered

Reimplemented from BALL::MOLFile.

virtual bool BALL::SDFile::read ( System system  )  [virtual]

Read a system from the SD file

Exceptions:
Exception::ParseError if a syntax error was encountered

Reimplemented from BALL::MOLFile.

void BALL::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 BALL::SDFile::write ( const Molecule molecule  )  [virtual]

Append a single molecule to the SD file.

Exceptions:
File::CannotWrite if writing to the file failed

Reimplemented from BALL::MOLFile.

virtual bool BALL::SDFile::write ( const System system  )  [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.

Exceptions:
File::CannotWrite if writing to the file failed

Reimplemented from BALL::MOLFile.

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

Read the propertyblock of an SD file. The values are stored as named properties in the molecule read.


Member Data Documentation

Whether atoms and bonds should be read

Definition at line 110 of file SDFile.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Generated by  doxygen 1.6.3