OEReadMolFromStringΒΆ

bool OEReadMolFromString(OEMolBase &mol, const std::string &format, const std::string &data)
bool OEReadMolFromString(OEMolBase &mol, unsigned format, bool gzip, const std::string &data)

bool OEReadMolFromString(OEMCMolBase &mol, const std::string &format, const std::string &data)
bool OEReadMolFromString(OEMCMolBase &mol, unsigned format, bool gzip, const std::string &data)

Interprets a molecule from the contents of ‘data’ in terms of ‘format’. ‘format’ must be a file extension that is both readable by OpenEye. For example: ”.oeb.gz”. The overloads which take a Boolean ‘gzip’ parameter expect format to be specified by one of the constants in OEFormat.

Returns ‘true’ if decoding was successful.

OEGraphMol mol;
bool success = OEReadMolFromString(mol, ".smi", "c1ccccc1");
OEGraphMol mol;
bool success = OEReadMolFromString(mol, OEFormat::SMI, false, "c1ccccc1");