//----------------------------------------------------------------------------- void CNewFileSelector::setDefaultExtension (const CFileExtension& extension) { if (defaultExtension) { #if DEBUG DebugPrint ("VSTGUI Warning: It's not allowed to set a default extension twice on a CFileSelector instance\n"); #endif return; } bool found = false; FileExtensionList::const_iterator it = extensions.begin (); while (it != extensions.end ()) { if ((*it) == extension) { defaultExtension = &(*it); found = true; break; } it++; } if (!found) { addFileExtension (extension); setDefaultExtension (extension); } }
QAbstractCoder::QAbstractCoder() { mName = "undefined"; mVersion = "undefined"; setError(QCoder::NoError); addFileExtension(""); addFileExtension(".a"); addFileExtension(".lib"); #ifdef WINDOWS addFileExtension(".dll"); #elif defined MACOSX addFileExtension(".so"); addFileExtension(".dylib"); #elif defined LINUX addFileExtension(".so"); #endif }
/*! * \fn void exportCsu() * Export a csu file into a csv or pdf file */ void exportCsu() { csuStruct *ptr_csu_struct; char filename[SIZE_MAX_FILE_NAME]; char export_filename[SIZE_MAX_FILE_NAME]; FileType type; clearScreen(); // Get the filename menuFileName(filename); #ifndef PORTABLE if(readSystemPath(filename)==false) return; #endif // PORTABLE ptr_csu_struct=readCsuFile(filename); // Read the file if (ptr_csu_struct == NULL) { systemPause(); return; } // Prepare the exportation strcpy(export_filename,filename); removeFileExtension(export_filename); type = menuChooseExportFileType(); if (type == pdf_file) { addFilePdfExtension(export_filename); if (exportToPdf(ptr_csu_struct,export_filename)) printf(_("The file was well export to %s\n"),export_filename); else printf(_("There is an error when exporting the file %s into a pdf file.\n"),filename); } else if (type == gnuplot_file) { if (exportToGnuplotFile(ptr_csu_struct,export_filename)) printf(_("The file was well export to %s\n"),export_filename); else printf(_("There is an error when exporting the file %s into gnuplot files.\n"),filename); } else if (type == csv_file) { addFileCsvExtension(export_filename); if (exportToCsv(ptr_csu_struct,export_filename)) printf(_("The file was well export to %s\n"),export_filename); else printf(_("There is an error when exporting the file %s into a csv file.\n"),filename); } else { addFileExtension(export_filename,"m"); if (exportToM(ptr_csu_struct,export_filename)) printf(_("The file was well export to %s\n"),export_filename); else printf(_("There is an error when exporting the file %s into a m file.\n"),filename); } closeCsuStruct(ptr_csu_struct); systemPause(); }