#include <BALL/FORMAT/genericMolFile.h>
Public Member Functions | |
Constructors and Destructors | |
GenericMolFile () | |
GenericMolFile (const String &filename, File::OpenMode open_mode=std::ios::in) | |
virtual | ~GenericMolFile () |
Assignment | |
const GenericMolFile & | operator= (const GenericMolFile &rhs) |
Reading and Writing of Kernel Datastructures | |
virtual bool | write (const System &system) |
virtual bool | write (const Molecule &molecule) |
virtual bool | read (System &system) |
virtual Molecule * | read () |
Operators | |
virtual GenericMolFile & | operator>> (System &system) |
virtual GenericMolFile & | operator<< (const System &system) |
virtual GenericMolFile & | operator>> (Molecule &molecule) |
virtual GenericMolFile & | operator<< (const Molecule &molecule) |
Protected Member Functions | |
virtual void | initRead_ () |
virtual void | initWrite_ () |
Base class for all molecule file format classes. This class provides an interface for all molecular structure formats (except for PDB files, due to their complex and capricious structure and contents).
Definition at line 56 of file genericMolFile.h.
BALL::GenericMolFile::GenericMolFile | ( | ) |
Default constructor
BALL::GenericMolFile::GenericMolFile | ( | const String & | filename, | |
File::OpenMode | open_mode = std::ios::in | |||
) |
Detailed constructor
Exception::FileNotFound | if the file could not be opened |
virtual BALL::GenericMolFile::~GenericMolFile | ( | ) | [virtual] |
Destructor
virtual void BALL::GenericMolFile::initRead_ | ( | ) | [protected, virtual] |
Initialize internals for read. This method is called by the default implementation of read(System& system) . Its purpose is the initialization of internal members holding, for example, header information from the file. The default implementation provided is empty.
Reimplemented in BALL::GAMESSDatFile, BALL::GAMESSLogFile, and BALL::HINFile.
virtual void BALL::GenericMolFile::initWrite_ | ( | ) | [protected, virtual] |
Initialize internals for write. Same functionality as initRead , but is called prior to writing a system.
virtual GenericMolFile& BALL::GenericMolFile::operator<< | ( | const Molecule & | molecule | ) | [virtual] |
Stream operator for writing a system of molecules. Calls write()
File::CannotWrite | if writing to the file failed |
Reimplemented in BALL::PDBFile.
virtual GenericMolFile& BALL::GenericMolFile::operator<< | ( | const System & | system | ) | [virtual] |
Stream operator for writing a system of molecules. Calls write(const System& system) const .
File::CannotWrite | if writing to the file failed |
Reimplemented in BALL::PDBFile.
const GenericMolFile& BALL::GenericMolFile::operator= | ( | const GenericMolFile & | rhs | ) |
Assignment operator. Create a new object pointing to the same filename.
Exception::FileNotFound | if the file could not be opened |
virtual GenericMolFile& BALL::GenericMolFile::operator>> | ( | Molecule & | molecule | ) | [virtual] |
Stream operator for reading a molecule. Calls read()
Exception::ParseError | if a syntax error was encountered |
Reimplemented in BALL::PDBFile.
virtual GenericMolFile& BALL::GenericMolFile::operator>> | ( | System & | system | ) | [virtual] |
Stream operator for reading a system. Calls read(System&) .
Exception::ParseError | if a syntax error was encountered |
Reimplemented in BALL::PDBFile.
virtual Molecule* BALL::GenericMolFile::read | ( | ) | [virtual] |
Read a molecule. This method will load the first (or the next, on subsequent invocation) molecule from the file. If the file format does not support multiple molecules, only the first call to read will be successful. This method will create an instance of molecule and its the user's responsibility to destroy that molecule.
Exception::ParseError | if the contents of the file could not be parsed |
Reimplemented in BALL::AntechamberFile, BALL::GAMESSDatFile, BALL::GAMESSLogFile, BALL::HINFile, BALL::KCFFile, BALL::MOL2File, BALL::MOLFile, BALL::PDBFile, BALL::SDFile, and BALL::XYZFile.
Read a system. This method will read all molecules contained in the file and add them to the system.
Exception::ParseError | if the file could not be parsed while reading a molecule |
Reimplemented in BALL::AntechamberFile, BALL::GAMESSDatFile, BALL::GAMESSLogFile, BALL::HINFile, BALL::KCFFile, BALL::MOL2File, BALL::MOLFile, BALL::PDBFile, BALL::SDFile, and BALL::XYZFile.
Write a molecule. Repeated invocations of this method append molecules to the same file.
File::CannotWrite | if writing to the file failed |
Reimplemented in BALL::AntechamberFile, BALL::GAMESSDatFile, BALL::GAMESSLogFile, BALL::HINFile, BALL::KCFFile, BALL::MOL2File, BALL::MOLFile, BALL::PDBFile, BALL::SDFile, and BALL::XYZFile.
Write the molecules of a system. If the file format does not support multiple molecules in a single file, a warning should be printed and only the first molecule should be stored.
File::CannotWrite | if writing to the file failed |
Reimplemented in BALL::AntechamberFile, BALL::GAMESSDatFile, BALL::GAMESSLogFile, BALL::HINFile, BALL::KCFFile, BALL::MOL2File, BALL::MOLFile, BALL::PDBFile, BALL::SDFile, and BALL::XYZFile.