From 7325e67fb40f12c190845a0c43bb3e629bff3a8a Mon Sep 17 00:00:00 2001 From: Greg Landrum Date: Sat, 20 May 2017 15:46:29 +0200 Subject: [PATCH] Fix #1413 (#1414) * swig csharp wrappers now build * fix this in a way that does not break the java wrappers --- Code/JavaWrappers/FilterCatalog.i | 29 ++++++++++--------- .../csharp_wrapper/GraphMolCSharp.i | 2 ++ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Code/JavaWrappers/FilterCatalog.i b/Code/JavaWrappers/FilterCatalog.i index f4e0eb0e3..638b60d83 100644 --- a/Code/JavaWrappers/FilterCatalog.i +++ b/Code/JavaWrappers/FilterCatalog.i @@ -1,19 +1,19 @@ -/* +/* * Copyright (c) 2015, Novartis Institutes for BioMedical Research Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are - * met: + * met: * - * * Redistributions of source code must retain the above copyright + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided * with the distribution. - * * Neither the name of Novartis Institutes for BioMedical Research Inc. - * nor the names of its contributors may be used to endorse or promote + * * Neither the name of Novartis Institutes for BioMedical Research Inc. + * nor the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS @@ -41,7 +41,7 @@ #include #include #include - + // bug fix for swig, it removes these from their namespaces typedef RDCatalog::Catalog::paramType_t paramType_t; typedef RDCatalog::Catalog::entryType_t entryType_t; @@ -97,7 +97,7 @@ std::string str(data.begin(), data.end()); return new RDKit::FilterCatalog(str); } - + bool canSerialize() const { return RDKit::FilterCatalogCanSerialize(); } @@ -110,7 +110,7 @@ RDKit::FilterCatalog::CONST_SENTRY res = self->getFirstMatch(mol); return boost::const_pointer_cast(res); } - + std::vector > getMatches(const ROMol &mol) { std::vector matches = self->getMatches(mol); std::vector res; @@ -125,7 +125,7 @@ unsigned int addEntry(boost::shared_ptr entry) { return self->addEntry(entry); } - + bool removeEntry(boost::shared_ptr entry) { return self->removeEntry(entry); } @@ -133,7 +133,7 @@ // swig const-ptr shenanigans again boost::shared_ptr getEntry(unsigned int idx) const { return boost::const_pointer_cast( - self->getEntry(idx)); + self->getEntry(idx)); } unsigned int getIdxForEntry(const boost::shared_ptr &entry) const { @@ -157,6 +157,7 @@ %ignore RDKit::Dict::getPropList; +#ifdef SWIGJAVA %typemap(jni) std::string RDKit::FilterCatalog::Serialize "jbyteArray" %typemap(jtype) std::string RDKit::FilterCatalog::Serialize "byte[]" %typemap(jstype) std::string RDKit::FilterCatalog::Serialize "byte[]" @@ -167,7 +168,7 @@ $result = JCALL1(NewByteArray, jenv, $1.size()); JCALL4(SetByteArrayRegion, jenv, $result, 0, $1.size(), (const jbyte*)$1.c_str()); } - +#endif %include %include %include diff --git a/Code/JavaWrappers/csharp_wrapper/GraphMolCSharp.i b/Code/JavaWrappers/csharp_wrapper/GraphMolCSharp.i index 052c0ce8f..2d0d8d387 100644 --- a/Code/JavaWrappers/csharp_wrapper/GraphMolCSharp.i +++ b/Code/JavaWrappers/csharp_wrapper/GraphMolCSharp.i @@ -199,6 +199,7 @@ typedef unsigned long long int uintmax_t; %include "../types.i" // Conformer seems to need to come before ROMol %include "../Conformer.i" +%include "../Dict.i" %include "../RDProps.i" %include "../ROMol.i" %include "../RWMol.i" @@ -212,6 +213,7 @@ typedef unsigned long long int uintmax_t; %include "../QueryAtom.i" %include "../QueryBond.i" %include "../QueryOps.i" +%include "../MonomerInfo.i" %include "../PeriodicTable.i" %include "../SanitException.i" %include "../SmilesParse.i"