Commit 75ffd978 by Maarten L. Hekkelman

use gxrio internally for reading pdb files

parent cfd5b7da
...@@ -32,6 +32,7 @@ namespace cif::pdb ...@@ -32,6 +32,7 @@ namespace cif::pdb
{ {
file read(std::istream &is); file read(std::istream &is);
file read(const std::filesystem::path &file);
void write(std::ostream &os, const datablock &db); void write(std::ostream &os, const datablock &db);
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <stack> #include <stack>
#include <cif++.hpp> #include <cif++.hpp>
#include <gxrio.hpp>
#include <cif++/pdb/pdb2cif.hpp> #include <cif++/pdb/pdb2cif.hpp>
#include <cif++/pdb/pdb2cif_remark_3.hpp> #include <cif++/pdb/pdb2cif_remark_3.hpp>
...@@ -6195,4 +6196,13 @@ file read(std::istream &is) ...@@ -6195,4 +6196,13 @@ file read(std::istream &is)
return result; return result;
} }
file read(const std::filesystem::path &file)
{
gxrio::ifstream in(file);
if (not in.is_open())
throw std::runtime_error("Could not open file " + file.string() + " for input");
return read(in);
}
} // namespace pdbx } // namespace pdbx
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment