void GDSin::Gds2Ted::child_structure(const GDSin::GDSHierTree* root, bool overwrite) { const GDSin::GDSHierTree* Child = root->GetChild(TARGETDB_LIB); while (Child) { if ( !Child->GetItem()->traversed() ) { // traverse children first child_structure(Child, overwrite); convert_prep(Child, overwrite); } Child = Child->GetBrother(TARGETDB_LIB); } }
void GDSin::Gds2Ted::top_structure(std::string top_str, bool recursive, bool overwrite) { assert(_src_lib->hierTree()); GDSin::GdsStructure *src_structure = _src_lib->getStructure(top_str.c_str()); if (NULL != src_structure) { GDSin::GDSHierTree* root = _src_lib->hierTree()->GetMember(src_structure); if (recursive) child_structure(root, overwrite); convert_prep(root, overwrite); root = root->GetNextRoot(TARGETDB_LIB); } else { std::ostringstream ost; ost << "GDS import: "; ost << "Structure \""<< top_str << "\" not found in the GDS DB in memory."; tell_log(console::MT_WARNING,ost.str()); } }
void CIFin::Cif2Ted::top_structure(std::string top_str, bool recursive, bool overwrite) { assert(_src_lib->hiertree()); CIFin::CifStructure *src_structure = _src_lib->getStructure(top_str); if (NULL != src_structure) { CIFin::CIFHierTree* root = _src_lib->hiertree()->GetMember(src_structure); if (recursive) child_structure(root, overwrite); convert_prep(root, overwrite); root = root->GetNextRoot(TARGETDB_LIB); } else { std::ostringstream ost; ost << "CIF import: "; ost << "Structure \""<< top_str << "\" not found in the CIF DB in memory."; tell_log(console::MT_WARNING,ost.str()); } // Convert the top structure // hCellBrowser->AddRoot(wxString((_src_lib->Get_libname()).c_str(), wxConvUTF8)); }
int *prepare_str_UTF8 (int *x) { int *v = prep_ibuf; int i, n; for (i = 0; x[i]; i++) { v[i] = convert_prep (x[i]); } int j = 0; // yo, jo -> e /* for (i = 0; v[i]; i++) { if ((v[i] == 'y' || v[i] == 'j') && v[i + 1] == 'o') { v[j++] = 'e'; i++; } else { v[j++] = v[i]; } } v[j] = 0; i = j; j = 0;*/ n = i; for (i = 0; v[i] == ' '; i++) { } int k = 0; while (i < n) { words_ibuf[k++] = v + i; while (v[i] && v[i] != ' ') { i++; } while (v[i] == ' ') { i++; } } v[n] = ' '; j = 0; qsort (words_ibuf, k, sizeof (int *), stricmp_void); for (i = 0; i < k; i++) { if (i == 0 || !ispref (words_ibuf[j - 1], words_ibuf[i])) { words_ibuf[j++] = words_ibuf[i]; } else { words_ibuf[j - 1] = words_ibuf[i]; } } k = j; int *res = prep_ibuf_res; for (i = 0; i < k; i++) { int *tmp = words_ibuf[i]; while (*tmp != ' ') { *res++ = *tmp++; } *res++ = '+'; } *res++ = 0; assert (res - prep_ibuf_res < MAX_NAME_SIZE); return prep_ibuf_res; }