mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
[v2 API] SMILES/SMARTS parsers (#6203)
* basic approach to v2api * does not work, backup commit * well, that now compiles * cleaner * more cleanup and testing * get the SWIG wrappers to build * swig wrappers now build * switch back to using references to default values * adjust to new catch version * move the implementation to v2 and call it from v1 * update the parameter object too * move debugParse down * a couple of review changes * make v2 naming consistent with Python
This commit is contained in:
@@ -110,14 +110,14 @@
|
||||
%}
|
||||
|
||||
// ===== SmilesParseException =====
|
||||
%typemap(javabase) RDKit::SmilesParseException "java.lang.RuntimeException";
|
||||
%typemap(throws, throws="org.RDKit.SmilesParseException") RDKit::SmilesParseException {
|
||||
%typemap(javabase) RDKit::SmilesParse::SmilesParseException "java.lang.RuntimeException";
|
||||
%typemap(throws, throws="org.RDKit.SmilesParseException") RDKit::SmilesParse::SmilesParseException {
|
||||
jclass excep = jenv->FindClass("org/RDKit/SmilesParseException");
|
||||
if (excep)
|
||||
jenv->ThrowNew(excep, $1.what());
|
||||
return $null;
|
||||
}
|
||||
%typemap(javacode) RDKit::SmilesParseException %{
|
||||
%typemap(javacode) RDKit::SmilesParse::SmilesParseException %{
|
||||
public String getMessage() {
|
||||
return what();
|
||||
}
|
||||
|
||||
@@ -68,6 +68,8 @@
|
||||
%javaconst(1);
|
||||
#endif
|
||||
%include <GraphMol/FileParsers/FileParsers.h>
|
||||
%ignore RDKit::v2;
|
||||
%ignore RDKit::v2::SmilesParse;
|
||||
%include <GraphMol/SmilesParse/SmilesParse.h>
|
||||
%include <GraphMol/RWMol.h>
|
||||
|
||||
@@ -76,7 +78,7 @@
|
||||
std::map<std::string,std::string> *replacements=0){
|
||||
return RDKit::RWMOL_SPTR(RDKit::SmilesToMol(smi, debugParse, sanitize,replacements));
|
||||
}
|
||||
static RDKit::RWMOL_SPTR MolFromSmiles(const std::string &smi, const RDKit::SmilesParserParams ¶ms){
|
||||
static RDKit::RWMOL_SPTR MolFromSmiles(const std::string &smi, const RDKit::v1::SmilesParserParams ¶ms){
|
||||
return RDKit::RWMOL_SPTR(RDKit::SmilesToMol(smi, params));
|
||||
}
|
||||
static RDKit::RWMOL_SPTR MolFromSmarts(const std::string &sma,int debugParse=0,bool mergeHs=false,
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
%{
|
||||
#include <GraphMol/SmilesParse/SmilesParse.h>
|
||||
%}
|
||||
%ignore RDKit::v2;
|
||||
%ignore SmilesToMol;
|
||||
%ignore SmartsToMol;
|
||||
%include <GraphMol/SmilesParse/SmilesParse.h>
|
||||
|
||||
@@ -166,7 +166,7 @@ typedef unsigned long long int uintmax_t;
|
||||
%shared_ptr(RDKit::AtomValenceException)
|
||||
%shared_ptr(RDKit::AtomKekulizeException)
|
||||
%shared_ptr(RDKit::KekulizeException)
|
||||
%shared_ptr(RDKit::SmilesParseException)
|
||||
%shared_ptr(RDKit::SmilesParse::SmilesParseException)
|
||||
%shared_ptr(RDKit::RingInfo)
|
||||
%shared_ptr(RDKit::ChemicalReaction)
|
||||
%shared_ptr(ForceFields::ForceFieldContrib);
|
||||
|
||||
Reference in New Issue
Block a user