19 #ifndef OST_IO_ENTITY_IO_PLUGIN_CRD_H
20 #define OST_IO_ENTITY_IO_PLUGIN_CRD_H
28 #include <boost/iostreams/filtering_stream.hpp>
29 #include <boost/filesystem/fstream.hpp>
31 namespace ost {
namespace io {
35 CRDReader(
const boost::filesystem::path& loc);
37 void Import(mol::EntityHandle& ent);
39 std::vector<mol::AtomHandle> GetSequentialAtoms()
const;
43 void ParseAndAddAtom(
const String& line, mol::EntityHandle& h);
44 void ParseAndAddAtomExpanded(
const String& line, mol::EntityHandle& h);
46 std::vector<mol::AtomHandle> sequential_atom_list_;
47 mol::ChainHandle curr_chain_;
48 mol::ResidueHandle curr_residue_;
52 boost::filesystem::ifstream infile_;
53 boost::iostreams::filtering_stream<boost::iostreams::input> in_;
59 CRDWriter(
const String& filename);
60 CRDWriter(
const boost::filesystem::path& filename);
61 CRDWriter(std::ostream& outstream);
63 virtual bool VisitAtom(
const mol::AtomHandle& atom);
65 void WriteHeader(
const mol::EntityView& ent);
68 std::ofstream outfile_;
69 std::ostream& outstream_;
76 virtual void Import(mol::EntityHandle& ent,
const boost::filesystem::path& loc);
78 virtual void Export(
const mol::EntityView& ent,
79 const boost::filesystem::path& loc)
const;
81 virtual void Import(mol::EntityHandle& ent, std::istream& stream);
83 virtual void Export(
const mol::EntityView& ent, std::ostream& stream)
const;
85 static bool ProvidesImport(
const boost::filesystem::path& loc,
86 const String& format=
"auto");
87 static bool ProvidesExport(
const boost::filesystem::path& loc,
88 const String& format=
"auto");
89 virtual bool RequiresBuilder()
const;