From 38154cc6e24bf787ebcc023352065728e282cdba Mon Sep 17 00:00:00 2001 From: Ric Date: Fri, 8 Mar 2024 23:11:26 -0500 Subject: [PATCH] add moveTo to v1suppliers (#7222) --- Code/GraphMol/FileParsers/MolSupplier.h | 6 ++--- Code/GraphMol/FileParsers/MolSupplier.v1API.h | 22 ++++++++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Code/GraphMol/FileParsers/MolSupplier.h b/Code/GraphMol/FileParsers/MolSupplier.h index 4b6ea90f9..1cda4c849 100644 --- a/Code/GraphMol/FileParsers/MolSupplier.h +++ b/Code/GraphMol/FileParsers/MolSupplier.h @@ -251,7 +251,7 @@ class RDKIT_FILEPARSERS_EXPORT SmilesMolSupplier : public MolSupplier { * file parser above * - As an when new molecules are read using "next" their * positions in the file are noted. - * - A call to the "length" will autamatically parse the entire + * - A call to the "length" will automatically parse the entire * file and cache all the mol block positions * - [] operator is used to access a molecule at "idx", calling * next following this will result in the next molecule after @@ -343,7 +343,7 @@ class RDKIT_FILEPARSERS_EXPORT TDTMolSupplier : public MolSupplier { * file parser above * - As an when new molecules are read using "next" their * positions in the file are noted. - * - A call to the "length" will autamatically parse the entire + * - A call to the "length" will automatically parse the entire * file and cache all the mol block positions * - [] operator is used to access a molecule at "idx", calling * next following this will result in the next molecule after @@ -399,7 +399,7 @@ class RDKIT_FILEPARSERS_EXPORT TDTMolSupplier : public MolSupplier { TDTMolSupplierParams d_params; }; -//! Deprectead, will be removed in 2024.09 release +//! Deprecated, will be removed in 2024.09 release class RDKIT_FILEPARSERS_EXPORT PDBMolSupplier : public MolSupplier { public: explicit PDBMolSupplier(std::istream *inStream, bool takeOwnership = true, diff --git a/Code/GraphMol/FileParsers/MolSupplier.v1API.h b/Code/GraphMol/FileParsers/MolSupplier.v1API.h index 7783fd841..26fda1e6c 100644 --- a/Code/GraphMol/FileParsers/MolSupplier.v1API.h +++ b/Code/GraphMol/FileParsers/MolSupplier.v1API.h @@ -171,6 +171,10 @@ class RDKIT_FILEPARSERS_EXPORT SDMolSupplier : public ForwardSDMolSupplier { new v2::FileParsers::SDMolSupplier(inStream, takeOwnership, params)); } + void moveTo(unsigned int idx) { + PRECONDITION(dp_supplier, "no supplier"); + static_cast(dp_supplier.get())->moveTo(idx); + } ROMol *operator[](unsigned int idx) { PRECONDITION(dp_supplier, "no supplier"); return static_cast(dp_supplier.get()) @@ -231,7 +235,7 @@ class RDKIT_FILEPARSERS_EXPORT SmilesMolSupplier : public MolSupplier { * file parser above * - As an when new molecules are read using "next" their * positions in the file are noted. - * - A call to the "length" will autamatically parse the entire + * - A call to the "length" will automatically parse the entire * file and cache all the mol block positions * - [] operator is used to access a molecule at "idx", calling * next following this will result in the next molecule after @@ -298,6 +302,10 @@ class RDKIT_FILEPARSERS_EXPORT SmilesMolSupplier : public MolSupplier { params.parseParameters.sanitize = sanitize; static_cast(dp_supplier.get())->setData(text, params); } + void moveTo(unsigned int idx) { + PRECONDITION(dp_supplier, "no supplier"); + static_cast(dp_supplier.get())->moveTo(idx); + } ROMol *operator[](unsigned int idx) { PRECONDITION(dp_supplier, "no supplier"); return static_cast(dp_supplier.get()) @@ -326,7 +334,7 @@ class RDKIT_FILEPARSERS_EXPORT TDTMolSupplier : public MolSupplier { * file parser above * - As an when new molecules are read using "next" their * positions in the file are noted. - * - A call to the "length" will autamatically parse the entire + * - A call to the "length" will automatically parse the entire * file and cache all the mol block positions * - [] operator is used to access a molecule at "idx", calling * next following this will result in the next molecule after @@ -378,6 +386,10 @@ class RDKIT_FILEPARSERS_EXPORT TDTMolSupplier : public MolSupplier { params.parseParameters.sanitize = sanitize; static_cast(dp_supplier.get())->setData(text, params); } + void moveTo(unsigned int idx) { + PRECONDITION(dp_supplier, "no supplier"); + static_cast(dp_supplier.get())->moveTo(idx); + } ROMol *operator[](unsigned int idx) { PRECONDITION(dp_supplier, "no supplier"); return static_cast(dp_supplier.get()) @@ -399,7 +411,7 @@ class RDKIT_FILEPARSERS_EXPORT TDTMolSupplier : public MolSupplier { } }; -//! Deprectead, will be removed in 2024.09 release +//! Deprecated, will be removed in 2024.09 release class RDKIT_FILEPARSERS_EXPORT PDBMolSupplier : public MolSupplier { public: explicit PDBMolSupplier(std::istream *inStream, bool takeOwnership = true, @@ -462,6 +474,10 @@ class RDKIT_FILEPARSERS_EXPORT MaeMolSupplier : public MolSupplier { params.removeHs = removeHs; dp_supplier.reset(new ContainedType(fname, params)); } + void moveTo(unsigned int idx) { + PRECONDITION(dp_supplier, "no supplier"); + static_cast(dp_supplier.get())->moveTo(idx); + } RWMol *operator[](unsigned int idx) { PRECONDITION(dp_supplier, "no supplier"); return static_cast(dp_supplier.get())