Commit 0dc19e86 by Maarten L. Hekkelman

fixed example

parent a12acaa5
...@@ -8,5 +8,5 @@ Name: libcifpp ...@@ -8,5 +8,5 @@ Name: libcifpp
Description: C++ library for the manipulation of mmCIF files. Description: C++ library for the manipulation of mmCIF files.
Version: @PACKAGE_VERSION@ Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lcifpp -lboost_regex -lboost_iostreams Libs: -L${libdir} -lcifpp -lboost_regex -lz
Cflags: -I${includedir} -pthread Cflags: -I${includedir} -pthread
...@@ -130,6 +130,20 @@ std::tuple<file::iterator, bool> file::emplace(std::string_view name) ...@@ -130,6 +130,20 @@ std::tuple<file::iterator, bool> file::emplace(std::string_view name)
return std::make_tuple(begin(), is_new); return std::make_tuple(begin(), is_new);
} }
void file::load(const std::filesystem::path &p)
{
if (p.extension() == ".gz")
{
gzstream::ifstream in(p);
load(in);
}
else
{
std::ifstream in(p, std::ios::binary);
load(in);
}
}
void file::load(std::istream &is) void file::load(std::istream &is)
{ {
auto saved = m_validator; auto saved = m_validator;
......
...@@ -420,8 +420,6 @@ const validator &validator_factory::operator[](std::string_view dictionary_name) ...@@ -420,8 +420,6 @@ const validator &validator_factory::operator[](std::string_view dictionary_name)
throw std::runtime_error("Dictionary not found or defined (" + dictionary.string() + ")"); throw std::runtime_error("Dictionary not found or defined (" + dictionary.string() + ")");
} }
assert(iequals(m_validators.back().name(), dictionary_name));
return m_validators.back(); return m_validators.back();
} }
......
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