void db_x509req::store(QModelIndex index) { QList<exportType> types; pki_x509req *req = static_cast<pki_x509req*>(index.internalPointer()); if (!req) return; types << exportType(exportType::PEM, "pem", "PEM") << exportType(exportType::DER, "der", "DER"); ExportDialog *dlg = new ExportDialog(mainwin, tr("Certificate request export"), tr("Certificate request ( *.pem *.der *.csr )"), req, MainWindow::csrImg, types); if (!dlg->exec()) { delete dlg; return; } QString fname = dlg->filename->text(); try { req->writeReq(fname, dlg->type() == exportType::PEM); } catch (errorEx &err) { mainwin->Error(err); } delete dlg; }
void Package::registerType(Type t, EmojicodeChar name, EmojicodeChar ns, bool exportFromPackage) { std::array<EmojicodeChar, 2> key = {ns, name}; types_.emplace(key, t); if (exportFromPackage) { exportType(t, name); } }
static void exportScope( const EngineExportScope* scope, SimXMLDocument* xml, bool addNode ) { if( addNode ) { if( isExportFiltered( scope ) ) return; xml->pushNewElement( "EngineExportScope" ); xml->setAttribute( "name", scope->getExportName() ); xml->setAttribute( "docs", getDocString( scope ) ); } // Dump all contained exports. xml->pushNewElement( "exports" ); for( const EngineExport* exportInfo = scope->getExports(); exportInfo != NULL; exportInfo = exportInfo->getNextExport() ) { switch( exportInfo->getExportKind() ) { case EngineExportKindScope: exportScope( static_cast< const EngineExportScope* >( exportInfo ), xml, true ); break; case EngineExportKindFunction: exportFunction( static_cast< const EngineFunctionInfo* >( exportInfo ), xml ); break; case EngineExportKindType: exportType( static_cast< const EngineTypeInfo* >( exportInfo ), xml ); break; default: break; } } xml->popElement(); if( addNode ) xml->popElement(); }