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(OEMolBase &mol, unsigned format, unsigned flavor, 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)
bool OEReadMolFromString(OEMCMolBase &mol, unsigned format, unsigned flavor, bool gzip, const std::string &data)

Instantiates a molecule from the contents of ‘data’ in terms of ‘format’. ‘format’ must be a file extension that is readable by OpenEye, for example: “.oeb.gz”. Overloads which take a Boolean ‘gzip’ parameter or an unsigned ‘flavor’ and Boolean ‘gzip’ parameters expect the format or the format and flavor to be specified by one of the constants in OEFormat and OEIFlavor.

Returns ‘true’ if decoding was successful.

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