Skip to content
Snippets Groups Projects
Commit f79af27f authored by Marco Biasini's avatar Marco Biasini
Browse files

fix BZDNG-334

parent feee6c97
No related branches found
No related tags found
No related merge requests found
...@@ -72,9 +72,11 @@ int main(int argc, char const *argv[]) ...@@ -72,9 +72,11 @@ int main(int argc, char const *argv[])
filtered_istream.push(istream); filtered_istream.push(istream);
io::ChemdictParser cdp(filtered_istream, dialect); io::ChemdictParser cdp(filtered_istream, dialect);
conop::CompoundLibPtr compound_lib; conop::CompoundLibPtr compound_lib;
if (!strcmp(argv[1], "create")) { bool in_mem=false;
compound_lib=conop::CompoundLib::Create(argv[3]); if (!strncmp(argv[1], "create", 6)) {
} else if (!strcmp(argv[1], "update")) { compound_lib=conop::CompoundLib::Create(":memory:");
in_mem=true;
} else if (!strncmp(argv[1], "update", 6)) {
compound_lib=conop::CompoundLib::Load(argv[3]); compound_lib=conop::CompoundLib::Load(argv[3]);
} else { } else {
PrintUsage(); PrintUsage();
...@@ -84,7 +86,8 @@ int main(int argc, char const *argv[]) ...@@ -84,7 +86,8 @@ int main(int argc, char const *argv[])
return 0; return 0;
} }
assert(compound_lib); assert(compound_lib);
conop::CompoundLibPtr in_mem_lib=compound_lib->Copy(":memory:"); conop::CompoundLibPtr in_mem_lib=in_mem ? compound_lib :
compound_lib->Copy(":memory:");
compound_lib.reset(); compound_lib.reset();
cdp.SetCompoundLib(in_mem_lib); cdp.SetCompoundLib(in_mem_lib);
cdp.Parse(); cdp.Parse();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment