Output & IndigoOutput::get (IndigoObject &obj) { if (obj.type == OUTPUT) { Output *ptr = ((IndigoOutput &)obj).ptr; if (ptr == 0) throw IndigoError("output stream has been closed"); return *ptr; } throw IndigoError("%s is not an output", obj.debugInfo()); }
static void indigoSetMaxEmbeddings (int value) { Indigo &self = indigoGetInstance(); if (value <= 0) throw IndigoError("Maximum allowed embeddings limit must be positive."); self.max_embeddings = value; }
void IndigoOutput::toString (Array<char> &str) { if (_own_buf) str.copy(_buf); else throw IndigoError("can not convert %s to string", debugInfo()); }
static void indigoSetFilenameEncoding (const char *encoding) { Indigo &self = indigoGetInstance(); if (strcasecmp(encoding, "ASCII") == 0) self.filename_encoding = ENCODING_ASCII; else if (strcasecmp(encoding, "UTF-8") == 0) self.filename_encoding = ENCODING_UTF8; else throw IndigoError("unknown value: %s", encoding); }
static void indigoSetAromaticityModel (const char *model) { Indigo &self = indigoGetInstance(); if (strcasecmp(model, "basic") == 0) self.arom_options.method = AromaticityOptions::BASIC; else if (strcasecmp(model, "generic") == 0) self.arom_options.method = AromaticityOptions::GENERIC; else throw IndigoError("unknown value: %s. Allowed values are \"basic\", \"generic\"", model); }
void indigoProductEnumeratorSetOneTubeMode (const char *mode_string) { Indigo &self = indigoGetInstance(); if (strcmp(mode_string, "one-tube") == 0) self.rpe_params.is_one_tube = true; else if (strcmp(mode_string, "grid") == 0) self.rpe_params.is_one_tube = false; else throw IndigoError("%s is bad reaction product enumerator mode string", mode_string); }
static void indigoSetMolfileSavingMode (const char *mode) { Indigo &self = indigoGetInstance(); if (strcasecmp(mode, "2000") == 0) self.molfile_saving_mode = MolfileSaver::MODE_2000; else if (strcasecmp(mode, "3000") == 0) self.molfile_saving_mode = MolfileSaver::MODE_3000; else if (strcasecmp(mode, "auto") == 0) self.molfile_saving_mode = MolfileSaver::MODE_AUTO; else throw IndigoError("unknown value: %s", mode); }
const char * IndigoRdfReaction::getName () { if (_loaded) return _rxn.name.ptr(); Indigo &self = indigoGetInstance(); BufferScanner scanner(_data); scanner.readLine(self.tmp_string, true); if (strcmp(self.tmp_string.ptr(), "$RXN") != 0) throw IndigoError("IndigoRdfReaction::getName(): unexpected first line in the files with reactions." "'%s' has been found but '$RXN' has been expected."); // Read next line with the name scanner.readLine(self.tmp_string, true); return self.tmp_string.ptr(); }
static void indigoSetEmbeddingUniqueness (const char *mode) { Indigo &self = indigoGetInstance(); if (strcasecmp(mode, "atoms") == 0) { self.embedding_edges_uniqueness = false; self.find_unique_embeddings = true; } else if (strcasecmp(mode, "bonds") == 0) { self.embedding_edges_uniqueness = true; self.find_unique_embeddings = true; } else if (strcasecmp(mode, "none") == 0) { self.find_unique_embeddings = false; } else throw IndigoError("unknown value: %s", mode); }
Scanner & IndigoScanner::get (IndigoObject &obj) { if (obj.type == SCANNER) return *((IndigoScanner &)obj).ptr; throw IndigoError("%s is not a scanner", obj.debugInfo()); }