Skip to content
Snippets Groups Projects
Unverified Commit bf427cb1 authored by Xavier Robin's avatar Xavier Robin
Browse files

feat: detect version and print useful message if unsupported

parent 53a6eb58
No related branches found
No related tags found
No related merge requests found
......@@ -159,6 +159,11 @@ void SDFReader::ParseAndAddHeader(const String& line, int line_num,
break;
case 4: // counts line
{
String version_str=line.substr(34, 5);
if (version_str != "V2000") {
String msg="Unsupported SDF version: %s.";
throw IOException(str(format(msg) % version_str));
}
String s_anum=line.substr(0,3);
try {
atom_count_=boost::lexical_cast<int>(boost::trim_copy(s_anum));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment