OEWriteReceptorToString

std::string OEWriteReceptorToString(const std::string &format, const OEMolBase &mol)
std::string OEWriteReceptorToString(const std::string &format, OEMolBase &mol)

std::string OEWriteReceptorToString(unsigned int format, unsigned int flavor, bool gzip, const OEMolBase &mol)
std::string OEWriteReceptorToString(unsigned int format, unsigned int flavor, bool gzip, OEMolBase &mol)

Encodes a receptor in terms of ‘format’. ‘format’ must be a file extension that is writeable by OpenEye, for example: “.oeb.gz”. Overloads which take an unsigned ‘format’, unsigned ‘flavor’ and Boolean ‘gzip’ parameters expect the format and flavor to be specified by one of the constants in OEFormat and OEOFlavor.

Returns a non-empty std::string if the molecule to encode is identified as a receptor and encoding was successful.

std::string bytes = OEWriteReceptorToString(".oeb", receptor);
OEGraphMol receptorIO;
bool status = OEReadReceptorFromString(receptorIO, ".oeb", bytes);
std::string bytes = OEWriteReceptorToString(".oeb.gz", receptor);
OEGraphMol receptorIO;
bool status = OEReadReceptorFromString(receptorIO, ".oeb.gz", bytes);
bool gzip = false;
std::string bytes = OEWriteReceptorToString(OEFormat::OEB, OEGetDefaultOFlavor(OEFormat::OEB), gzip, receptor);
OEGraphMol receptorIO;
bool status = OEReadReceptorFromString(receptorIO, OEFormat::OEB, OEGetDefaultIFlavor(OEFormat::OEB), gzip, bytes);
bool gzip = true;
std::string bytes = OEWriteReceptorToString(OEFormat::OEB, OEGetDefaultOFlavor(OEFormat::OEB), gzip, receptor);
OEGraphMol receptorIO;
bool status = OEReadReceptorFromString(receptorIO, OEFormat::OEB, OEGetDefaultIFlavor(OEFormat::OEB), gzip, bytes);