classimport.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "classimport.h"
00014
00015 #include <qregexp.h>
00016 #include <klocale.h>
00017
00018 #include "../umldoc.h"
00019 #include "../uml.h"
00020 #include "idlimport.h"
00021 #include "pythonimport.h"
00022 #include "javaimport.h"
00023 #include "adaimport.h"
00024 #include "pascalimport.h"
00025 #include "cppimport.h"
00026
00027 void ClassImport::importFiles(const QStringList &fileList) {
00028 initialize();
00029 UMLDoc *umldoc = UMLApp::app()->getDocument();
00030 uint processedFilesCount = 0;
00031 for (QStringList::const_iterator fileIT = fileList.begin();
00032 fileIT != fileList.end(); ++fileIT) {
00033 QString fileName = (*fileIT);
00034 umldoc->writeToStatusBar(i18n("Importing file: %1 Progress: %2/%3").
00035 arg(fileName).arg(processedFilesCount).arg(fileList.size()));
00036 parseFile(fileName);
00037 processedFilesCount++;
00038 }
00039 umldoc->writeToStatusBar(i18n("Ready."));
00040 }
00041
00042 ClassImport *ClassImport::createImporterByFileExt(const QString &filename) {
00043 ClassImport *classImporter;
00044 if (filename.endsWith(".idl"))
00045 classImporter = new IDLImport();
00046 else if (filename.endsWith(".py"))
00047 classImporter = new PythonImport();
00048 else if (filename.endsWith(".java"))
00049 classImporter = new JavaImport();
00050 else if (filename.contains( QRegExp("\\.ad[sba]$") ))
00051 classImporter = new AdaImport();
00052 else if (filename.endsWith(".pas"))
00053 classImporter = new PascalImport();
00054 else
00055 classImporter = new CppImport();
00056 return classImporter;
00057 }
00058
This file is part of the documentation for umbrello Version 3.1.0.