00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef OST_IO_SDF_WRITER_HH
00023 #define OST_IO_SDF_WRITER_HH
00024
00025 #include <iostream>
00026 #include <sstream>
00027 #include <iomanip>
00028
00029 #include <boost/filesystem/fstream.hpp>
00030 #include <boost/filesystem/convenience.hpp>
00031 #include <boost/algorithm/string.hpp>
00032 #include <boost/lexical_cast.hpp>
00033 #include <boost/format.hpp>
00034 #include <ost/log.hh>
00035 #include <ost/conop/conop.hh>
00036 #include <ost/io/io_exception.hh>
00037 #include <ost/mol/entity_visitor.hh>
00038
00039 namespace ost { namespace io {
00040
00041 class DLLEXPORT_OST_IO SDFWriter : public mol::EntityViewVisitor {
00042 public:
00043 SDFWriter(std::ostream& ostream);
00044 SDFWriter(const String& filename);
00045 SDFWriter(const boost::filesystem::path& filename);
00046
00047 void Write(const mol::EntityView& ent);
00048 void Write(const mol::EntityHandle& ent);
00049
00050 private:
00051 virtual bool VisitChain(const mol::ChainView& chain);
00052
00053 std::ofstream outfile_;
00054 std::ostream& ostr_;
00055 int counter_;
00056 std::map<long,int> atom_indices_;
00057 };
00058
00059 }}
00060
00061 #endif