<commit_before>// $Id: genericMolFile.h,v 1.7 2001/12/20 01:10:49 oliver Exp $

#ifndef BALL_FORMAT_GENERICMOLFILE_H
#define BALL_FORMAT_GENERICMOLFILE_H

#ifndef BALL_FORMAT_LINEBASEDFILE_H
#	include <BALL/FORMAT/lineBasedFile.h>
#endif

namespace BALL 
{
	class Atom;
	class System;
	class Molecule;

	/**	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).\\
			GenericMolFile supports two type of operations: 
			reading/writing single molecules and reading/writing 
			systems (i.e. collections of molecules).\\
			When reading molecules, the structures are read one at
			a time from the file in the order they are stored.
			In contrast, reading systems retrieves all structures
			contained in the file. For file formats that do not support
			multiple structure in a file (e.g. the MDL \Ref{MOLFile}),
			those two operations are basically equivalent.
			A fundamental difference however is the fact that
			reading a molecule {\em create} a new molecule, whereas
			reading a system adds the molecules read to an
			existing instance of \Ref{System}. This implies that
			the system has to be cleared prior to reading a system
			if that incremental behaviour is not desired.\\
			The user interface of the class is mainly provided through
			the stream operator. A typical example for reading a structure 
			from a HyperChem file might look as follows:\\
			\begin{verbatim}
				HINFile hinfile(filename);
				System S;
				hinfile >> S;
			\end{verbatim}
			This interface applies to all derived classes as well, so that
			file formats can be exchanged conveniently.\\
			GenericMolFile is derived from \Ref{LineBasedFile} since most
			molecular structure formats are line-based tagged formats,
			often containing Fortran-style formatted sections. 
			\Ref{LineBasedFile} provides a number of convenient methods
			to parse that kind of format.
			\\
			{\bf Definition:} \URL{BALL/FORMAT/genericMolFile.h} 
	*/
	class GenericMolFile
		: public LineBasedFile
	{
		public:

		/**	@name	Constructors and Destructors
		*/
		//@{

		/**	Default constructor
		*/
		GenericMolFile()
			throw();

		/** Detailed constructor
		*/
		GenericMolFile(const String& filename, File::OpenMode open_mode = std::ios::in)
			throw(Exception::FileNotFound);

		/**	Copy constructor
		*/
		GenericMolFile(const GenericMolFile& file);<commit_msg>fixed: was using std::ios::out insteda of File::OUT<commit_after>// $Id: genericMolFile.h,v 1.8 2001/12/20 02:56:23 oliver Exp $

#ifndef BALL_FORMAT_GENERICMOLFILE_H
#define BALL_FORMAT_GENERICMOLFILE_H

#ifndef BALL_FORMAT_LINEBASEDFILE_H
#	include <BALL/FORMAT/lineBasedFile.h>
#endif

namespace BALL 
{
	class Atom;
	class System;
	class Molecule;

	/**	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).\\
			GenericMolFile supports two type of operations: 
			reading/writing single molecules and reading/writing 
			systems (i.e. collections of molecules).\\
			When reading molecules, the structures are read one at
			a time from the file in the order they are stored.
			In contrast, reading systems retrieves all structures
			contained in the file. For file formats that do not support
			multiple structure in a file (e.g. the MDL \Ref{MOLFile}),
			those two operations are basically equivalent.
			A fundamental difference however is the fact that
			reading a molecule {\em create} a new molecule, whereas
			reading a system adds the molecules read to an
			existing instance of \Ref{System}. This implies that
			the system has to be cleared prior to reading a system
			if that incremental behaviour is not desired.\\
			The user interface of the class is mainly provided through
			the stream operator. A typical example for reading a structure 
			from a HyperChem file might look as follows:\\
			\begin{verbatim}
				HINFile hinfile(filename);
				System S;
				hinfile >> S;
			\end{verbatim}
			This interface applies to all derived classes as well, so that
			file formats can be exchanged conveniently.\\
			GenericMolFile is derived from \Ref{LineBasedFile} since most
			molecular structure formats are line-based tagged formats,
			often containing Fortran-style formatted sections. 
			\Ref{LineBasedFile} provides a number of convenient methods
			to parse that kind of format.
			\\
			{\bf Definition:} \URL{BALL/FORMAT/genericMolFile.h} 
	*/
	class GenericMolFile
		: public LineBasedFile
	{
		public:

		/**	@name	Constructors and Destructors
		*/
		//@{

		/**	Default constructor
		*/
		GenericMolFile()
			throw();

		/** Detailed constructor
		*/
		GenericMolFile(const String& filename, File::OpenMode open_mode = File::IN)
			throw(Exception::FileNotFound);

		/**	Copy constructor
		*/
		GenericMolFile(const GenericMolFile& file);
{'fraction_non_alphanumeric': 0.06927352123858674, 'fraction_numerical': 0.006351726875744343, 'mean_word_length': 3.6442396313364056, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4608906', 'n_tokens_mistral': 1669, 'n_tokens_neox': 1398, 'n_words': 587}