void LitesqlGeneratePanel::OnRunClick( wxCommandEvent& WXUNUSED(event) ) { m_gaugeRunProgress->SetLabel(_("Running")); struct options_t { string output_dir; string output_includes; bool refresh; vector<string> targets; }; options_t options = {"","",true}; options.targets.push_back("c++"); options.output_includes = options.output_dir = m_dirPickerOutputDir->GetPath().ToUTF8(); CompositeGenerator generator; generator.setOutputDirectory(options.output_dir); for (size_t index=0; index < m_checkListGenerators->GetCount();index++) { if (m_checkListGenerators->IsChecked(index)) { string key(m_checkListGenerators->GetString(index).ToUTF8()); CodeGenerator::create(key.c_str()); CodeGenerator::FactoryMap::iterator it = CodeGenerator::getFactoryMap().find(key); if (it != CodeGenerator::getFactoryMap().end() && it->second!=NULL) { generator.add(it->second->create()); } } } wxString s (generator.generateCode( m_pModel.get()) ? _("Success") : _("Fail") ); wxMessageBox(s); }
CompositeGenerator<T> between( T from, T to ) { CompositeGenerator<T> generators; generators.add( new BetweenGenerator<T>( from, to ) ); return generators; }