From: <eg...@us...> - 2006-12-09 15:08:05
|
Revision: 7444 http://svn.sourceforge.net/cdk/?rev=7444&view=rev Author: egonw Date: 2006-12-09 07:08:02 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Fixed testing for format. It needs state now, but I think it will run fine like this. Modified Paths: -------------- trunk/cdk/src/org/openscience/cdk/io/formats/MDLRXNV3000Format.java Modified: trunk/cdk/src/org/openscience/cdk/io/formats/MDLRXNV3000Format.java =================================================================== --- trunk/cdk/src/org/openscience/cdk/io/formats/MDLRXNV3000Format.java 2006-12-09 15:07:03 UTC (rev 7443) +++ trunk/cdk/src/org/openscience/cdk/io/formats/MDLRXNV3000Format.java 2006-12-09 15:08:02 UTC (rev 7444) @@ -35,6 +35,9 @@ private static IResourceFormat myself = null; + // OK, add some state info + boolean isRXN = false; + private MDLRXNV3000Format() {} public static IResourceFormat getInstance() { @@ -62,11 +65,11 @@ public String getWriterClassName() { return null; } public boolean matches(int lineNumber, String line) { - if (lineNumber == 4 && - (line.indexOf("v3000") >= 0 || - line.indexOf("V3000") >= 0)) { - return true; - } + if (lineNumber == 1) { + isRXN = (line.indexOf("$RXN") != -1); + } else if (lineNumber == 5 && isRXN) { + return true; + } return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |