00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 00005 #ifndef BALL_FORMAT_SDFILE_H 00006 #define BALL_FORMAT_SDFILE_H 00007 00008 #ifndef BALL_FORMAT_MOLFILE_H 00009 # include <BALL/FORMAT/MOLFile.h> 00010 #endif 00011 00012 namespace BALL 00013 { 00022 class BALL_EXPORT SDFile 00023 : public MOLFile 00024 { 00025 public: 00026 00030 00033 SDFile(); 00034 00037 SDFile(const String& filename, File::OpenMode open_mode = std::ios::in) 00038 throw(Exception::FileNotFound); 00039 00041 virtual ~SDFile(); 00042 00044 00048 00054 virtual bool write(const System& system) 00055 throw(File::CannotWrite); 00056 00059 virtual bool write(const Molecule& molecule) 00060 throw(File::CannotWrite); 00061 00064 virtual bool read(System& system) 00065 throw(Exception::ParseError); 00066 00069 virtual Molecule* read() 00070 throw(Exception::ParseError); 00071 00082 void disableAtoms(); 00083 00087 void enableAtoms(); 00088 00090 const SDFile& operator = (const SDFile& file); 00091 00093 00094 protected: 00095 00100 void readPropertyBlock_(Molecule& molecule); 00101 00106 void writePropertyBlock_(const Molecule& molecule); 00107 00110 bool read_atoms_; 00111 }; 00112 } // namespace BALL 00113 00114 #endif // BALL_FORMAT_SDFILE_H