3 The file is used to init workspace and get basic information of workspace
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 package org
.tianocore
.frameworkwizard
.workspace
;
18 import java
.io
.IOException
;
19 import java
.util
.List
;
20 import java
.util
.Vector
;
22 import org
.apache
.xmlbeans
.XmlCursor
;
23 import org
.apache
.xmlbeans
.XmlException
;
24 import org
.tianocore
.DbPathAndFilename
;
25 import org
.tianocore
.IndustryStdIncludesDocument
.IndustryStdIncludes
;
26 import org
.tianocore
.ModuleSurfaceAreaDocument
.ModuleSurfaceArea
;
27 import org
.tianocore
.MsaFilesDocument
.MsaFiles
;
28 import org
.tianocore
.PackageSurfaceAreaDocument
.PackageSurfaceArea
;
29 import org
.tianocore
.PlatformSurfaceAreaDocument
.PlatformSurfaceArea
;
30 import org
.tianocore
.SourceFilesDocument
.SourceFiles
;
31 import org
.tianocore
.frameworkwizard
.common
.DataType
;
32 import org
.tianocore
.frameworkwizard
.common
.GlobalData
;
33 import org
.tianocore
.frameworkwizard
.common
.Log
;
34 import org
.tianocore
.frameworkwizard
.common
.OpenFile
;
35 import org
.tianocore
.frameworkwizard
.common
.SaveFile
;
36 import org
.tianocore
.frameworkwizard
.common
.Sort
;
37 import org
.tianocore
.frameworkwizard
.common
.Tools
;
38 import org
.tianocore
.frameworkwizard
.common
.Identifications
.Identification
;
39 import org
.tianocore
.frameworkwizard
.far
.FarHeader
;
40 import org
.tianocore
.frameworkwizard
.far
.FarIdentification
;
41 import org
.tianocore
.frameworkwizard
.module
.Identifications
.ModuleIdentification
;
42 import org
.tianocore
.frameworkwizard
.module
.Identifications
.PcdCoded
.PcdIdentification
;
43 import org
.tianocore
.frameworkwizard
.module
.Identifications
.PcdCoded
.PcdVector
;
44 import org
.tianocore
.frameworkwizard
.packaging
.PackageIdentification
;
45 import org
.tianocore
.frameworkwizard
.platform
.PlatformIdentification
;
47 public class WorkspaceTools
{
49 public void addFarToDb(List
<String
> packageList
, List
<String
> platformList
, FarHeader far
) {
50 //FrameworkDatabase fdb = openFrameworkDb();
52 for (int i
= 0; i
< packageList
.size(); i
++) {
53 DbPathAndFilename item
= DbPathAndFilename
.Factory
.newInstance();
54 item
.setFarGuid(far
.getGuidValue());
55 item
.setStringValue(packageList
.get(i
));
56 GlobalData
.fdb
.getPackageList().getFilenameList().add(item
);
59 for (int i
= 0; i
< platformList
.size(); i
++) {
60 DbPathAndFilename item
= DbPathAndFilename
.Factory
.newInstance();
61 item
.setFarGuid(far
.getGuidValue());
62 item
.setStringValue(platformList
.get(i
));
63 GlobalData
.fdb
.getPlatformList().getFilenameList().add(item
);
66 DbPathAndFilename farItem
= DbPathAndFilename
.Factory
.newInstance();
67 farItem
.setFarGuid(far
.getGuidValue());
68 farItem
.setStringValue(far
.getFarName());
69 GlobalData
.fdb
.getFarList().getFilenameList().add(farItem
);
71 String strFrameworkDbFilePath
= Workspace
.getCurrentWorkspace() + Workspace
.getStrWorkspaceDatabaseFile();
72 strFrameworkDbFilePath
= Tools
.convertPathToCurrentOsType(strFrameworkDbFilePath
);
75 SaveFile
.saveDbFile(strFrameworkDbFilePath
, GlobalData
.fdb
);
76 } catch (Exception e
) {
77 Log
.err("Save Database File", e
.getMessage());
81 public void removeFarFromDb(FarIdentification far
) {
85 XmlCursor cursor
= GlobalData
.fdb
.getPackageList().newCursor();
86 cursor
.toFirstChild();
88 DbPathAndFilename item
= (DbPathAndFilename
) cursor
.getObject();
90 if (item
.getFarGuid() != null && item
.getFarGuid().equalsIgnoreCase(far
.getGuid())) {
93 } while (cursor
.toNextSibling());
99 cursor
= GlobalData
.fdb
.getPlatformList().newCursor();
100 cursor
.toFirstChild();
102 DbPathAndFilename item
= (DbPathAndFilename
) cursor
.getObject();
103 if (item
.getFarGuid() != null && item
.getFarGuid().equalsIgnoreCase(far
.getGuid())) {
106 } while (cursor
.toNextSibling());
111 cursor
= GlobalData
.fdb
.getFarList().newCursor();
112 cursor
.toFirstChild();
114 DbPathAndFilename item
= (DbPathAndFilename
) cursor
.getObject();
115 if (item
.getFarGuid() != null && item
.getFarGuid().equalsIgnoreCase(far
.getGuid())) {
118 } while (cursor
.toNextSibling());
121 String strFrameworkDbFilePath
= Workspace
.getCurrentWorkspace() + Workspace
.getStrWorkspaceDatabaseFile();
122 strFrameworkDbFilePath
= Tools
.convertPathToCurrentOsType(strFrameworkDbFilePath
);
124 SaveFile
.saveDbFile(strFrameworkDbFilePath
, GlobalData
.fdb
);
125 } catch (Exception e
) {
126 Log
.err("Save Database File", e
.getMessage());
130 public String
getPackageFarGuid(Identification packageId
) {
131 for (int index
= 0; index
< GlobalData
.fdb
.getPackageList().getFilenameList().size(); index
++) {
132 DbPathAndFilename item
= GlobalData
.fdb
.getPackageList().getFilenameArray(index
);
133 String path
= Workspace
.getCurrentWorkspace() + DataType
.FILE_SEPARATOR
+ item
.getStringValue();
134 File tempFile
= new File(path
);
135 if (tempFile
.getPath().equalsIgnoreCase(packageId
.getPath())) {
136 return GlobalData
.fdb
.getPackageList().getFilenameArray(index
).getFarGuid();
143 public String
getPlatformFarGuid(Identification platformId
) {
144 for (int index
= 0; index
< GlobalData
.fdb
.getPlatformList().getFilenameList().size(); index
++) {
145 DbPathAndFilename item
= GlobalData
.fdb
.getPlatformList().getFilenameArray(index
);
146 String path
= Workspace
.getCurrentWorkspace() + DataType
.FILE_SEPARATOR
+ item
.getStringValue();
147 File tempFile
= new File(path
);
148 if (tempFile
.getPath().equalsIgnoreCase(platformId
.getPath())) {
149 return GlobalData
.fdb
.getPlatformList().getFilenameArray(index
).getFarGuid();
156 public String
getModuleFarGuid(Identification moduleId
) {
157 PackageIdentification packageId
= getPackageIdByModuleId(moduleId
);
158 if (packageId
!= null) {
159 return getPackageFarGuid(packageId
);
166 Get all modules' paths from one package
168 @return a Vector with all modules' path
171 public Vector
<String
> getAllModulesOfPackage(String path
) {
172 Vector
<String
> modulePath
= new Vector
<String
>();
173 PackageIdentification id
= new PackageIdentification(null, null, null, path
);
174 MsaFiles files
= GlobalData
.openingPackageList
.getPackageSurfaceAreaFromId(id
).getMsaFiles();
176 for (int index
= 0; index
< files
.getFilenameList().size(); index
++) {
177 String msaPath
= files
.getFilenameList().get(index
);
178 msaPath
= Tools
.addFileSeparator(Tools
.getFilePathOnly(path
)) + msaPath
;
179 msaPath
= Tools
.convertPathToCurrentOsType(msaPath
);
180 modulePath
.addElement(msaPath
);
188 Get all Industry Std Includes' paths from one package
190 @return a Vector with all paths
193 public Vector
<String
> getAllIndustryStdIncludesOfPackage(String path
) {
194 Vector
<String
> includePath
= new Vector
<String
>();
195 PackageIdentification id
= new PackageIdentification(null, null, null, path
);
196 IndustryStdIncludes files
= GlobalData
.openingPackageList
.getPackageSurfaceAreaFromId(id
)
197 .getIndustryStdIncludes();
199 for (int index
= 0; index
< files
.getIndustryStdHeaderList().size(); index
++) {
200 String temp
= files
.getIndustryStdHeaderList().get(index
).getIncludeHeader();
201 temp
= Tools
.addFileSeparator(Tools
.getFilePathOnly(path
)) + temp
;
202 temp
= Tools
.convertPathToCurrentOsType(temp
);
203 includePath
.addElement(temp
);
210 Get all package basic information form the FrameworkDatabase.db file
212 @return vPackageList A vector includes all packages' basic information
215 public Vector
<PackageIdentification
> getAllPackages() {
216 return GlobalData
.vPackageList
;
219 public Vector
<FarIdentification
> getAllFars() {
221 Vector
<FarIdentification
> v
= new Vector
<FarIdentification
>();
222 for (int index
= 0; index
< GlobalData
.fdb
.getFarList().getFilenameList().size(); index
++) {
223 DbPathAndFilename item
= GlobalData
.fdb
.getFarList().getFilenameList().get(index
);
224 FarIdentification far
= new FarIdentification(item
.getFarGuid(), item
.getMd5Sum(), item
.getStringValue());
230 public Vector
<PackageIdentification
> getPackagesByFar(FarIdentification far
) {
231 Identification id
= null;
233 Vector
<PackageIdentification
> v
= new Vector
<PackageIdentification
>();
235 for (int index
= 0; index
< GlobalData
.fdb
.getPackageList().getFilenameList().size(); index
++) {
236 DbPathAndFilename item
= GlobalData
.fdb
.getPackageList().getFilenameArray(index
);
237 String path
= Workspace
.getCurrentWorkspace() + DataType
.FILE_SEPARATOR
+ item
.getStringValue();
238 path
= Tools
.convertPathToCurrentOsType(path
);
240 if (item
.getFarGuid() != null && item
.getFarGuid().equalsIgnoreCase(far
.getGuid())) {
243 id
= Tools
.getId(path
, OpenFile
.openSpdFile(path
));
244 v
.addElement(new PackageIdentification(id
));
245 } catch (IOException e
) {
246 Log
.err("Open Package Surface Area " + path
, e
.getMessage());
247 } catch (XmlException e
) {
248 Log
.err("Open Package Surface Area " + path
, e
.getMessage());
249 } catch (Exception e
) {
250 Log
.err("Open Package Surface Area " + path
, "Invalid file type");
257 public Vector
<PlatformIdentification
> getPlatformsByFar(FarIdentification far
) {
258 Identification id
= null;
260 Vector
<PlatformIdentification
> v
= new Vector
<PlatformIdentification
>();
262 for (int index
= 0; index
< GlobalData
.fdb
.getPlatformList().getFilenameList().size(); index
++) {
263 DbPathAndFilename item
= GlobalData
.fdb
.getPlatformList().getFilenameArray(index
);
264 String path
= Workspace
.getCurrentWorkspace() + DataType
.FILE_SEPARATOR
+ item
.getStringValue();
265 path
= Tools
.convertPathToCurrentOsType(path
);
267 if (item
.getFarGuid() != null && item
.getFarGuid().equalsIgnoreCase(far
.getGuid())) {
269 id
= Tools
.getId(path
, OpenFile
.openFpdFile(path
));
270 v
.addElement(new PlatformIdentification(id
));
271 } catch (IOException e
) {
272 Log
.err("Open Platform Surface Area " + path
, e
.getMessage());
273 } catch (XmlException e
) {
274 Log
.err("Open Platform Surface Area " + path
, e
.getMessage());
275 } catch (Exception e
) {
276 Log
.err("Open Platform Surface Area " + path
, "Invalid file type");
284 Get all module basic information from a package
287 @return A vector includes all modules' basic information
290 public Vector
<ModuleIdentification
> getAllModules(PackageIdentification pid
) {
291 Vector
<ModuleIdentification
> v
= new Vector
<ModuleIdentification
>();
292 Vector
<String
> modulePaths
= this.getAllModulesOfPackage(pid
.getPath());
293 String modulePath
= null;
295 for (int index
= 0; index
< modulePaths
.size(); index
++) {
296 modulePath
= modulePaths
.get(index
);
297 ModuleIdentification id
= GlobalData
.openingModuleList
.getIdByPath(modulePath
);
302 Sort
.sortModules(v
, DataType
.SORT_TYPE_ASCENDING
);
307 Get all module basic information from a platform
310 @return A vector includes all modules' basic information
313 public Vector
<ModuleIdentification
> getAllModules(PlatformIdentification fid
) {
314 Vector
<ModuleIdentification
> v
= new Vector
<ModuleIdentification
>();
315 PlatformSurfaceArea fpd
= GlobalData
.openingPlatformList
.getOpeningPlatformById(fid
).getXmlFpd();
316 if (fpd
.getFrameworkModules() != null) {
317 for (int index
= 0; index
< fpd
.getFrameworkModules().getModuleSAList().size(); index
++) {
318 String guid
= fpd
.getFrameworkModules().getModuleSAList().get(index
).getModuleGuid();
319 String version
= fpd
.getFrameworkModules().getModuleSAList().get(index
).getModuleVersion();
320 ModuleIdentification id
= GlobalData
.openingModuleList
.getIdByGuidVersion(guid
, version
);
322 boolean isFind
= false;
323 for (int indexOfModules
= 0; indexOfModules
< v
.size(); indexOfModules
++) {
324 if (v
.elementAt(indexOfModules
).equals(id
)) {
335 Sort
.sortModules(v
, DataType
.SORT_TYPE_ASCENDING
);
340 Get all module basic information form the FrameworkDatabase.db file
342 @return vModuleList A vector includes all modules' basic information
345 public Vector
<ModuleIdentification
> getAllModules() {
346 return GlobalData
.vModuleList
;
350 Get all platform basic information form the FrameworkDatabase.db file
352 @return vplatformList A vector includes all platforms' basic information
355 public Vector
<PlatformIdentification
> getAllPlatforms() {
356 return GlobalData
.vPlatformList
;
360 Get all Library Class Definitions from a package
364 public Vector
<String
> getAllLibraryClassDefinitionsFromPackage(PackageSurfaceArea spd
) {
365 Vector
<String
> vector
= new Vector
<String
>();
366 if (spd
.getLibraryClassDeclarations() != null) {
367 if (spd
.getLibraryClassDeclarations().getLibraryClassList().size() > 0) {
368 for (int index
= 0; index
< spd
.getLibraryClassDeclarations().getLibraryClassList().size(); index
++) {
369 vector
.addElement(spd
.getLibraryClassDeclarations().getLibraryClassList().get(index
).getName());
373 Sort
.sortVectorString(vector
, DataType
.SORT_TYPE_ASCENDING
);
378 Get all Protocol Definitions from a package
382 public Vector
<String
> getAllProtocolDeclarationsFromPackage(PackageSurfaceArea spd
) {
383 Vector
<String
> vector
= new Vector
<String
>();
384 if (spd
.getProtocolDeclarations() != null) {
385 if (spd
.getProtocolDeclarations().getEntryList().size() > 0) {
386 for (int index
= 0; index
< spd
.getProtocolDeclarations().getEntryList().size(); index
++) {
387 vector
.addElement(spd
.getProtocolDeclarations().getEntryList().get(index
).getCName());
391 Sort
.sortVectorString(vector
, DataType
.SORT_TYPE_ASCENDING
);
396 Get all Ppi Definitions from a package
400 public Vector
<String
> getAllPpiDeclarationsFromPackage(PackageSurfaceArea spd
) {
401 Vector
<String
> vector
= new Vector
<String
>();
402 if (spd
.getPpiDeclarations() != null) {
403 if (spd
.getPpiDeclarations().getEntryList().size() > 0) {
404 for (int index
= 0; index
< spd
.getPpiDeclarations().getEntryList().size(); index
++) {
405 vector
.addElement(spd
.getPpiDeclarations().getEntryList().get(index
).getCName());
409 Sort
.sortVectorString(vector
, DataType
.SORT_TYPE_ASCENDING
);
414 Get all Guid Definitions from a package
418 public Vector
<String
> getAllGuidDeclarationsFromPackage(PackageSurfaceArea spd
) {
419 Vector
<String
> vector
= new Vector
<String
>();
420 if (spd
.getGuidDeclarations() != null) {
421 if (spd
.getGuidDeclarations().getEntryList().size() > 0) {
422 for (int index
= 0; index
< spd
.getGuidDeclarations().getEntryList().size(); index
++) {
423 vector
.addElement(spd
.getGuidDeclarations().getEntryList().get(index
).getCName());
427 Sort
.sortVectorString(vector
, DataType
.SORT_TYPE_ASCENDING
);
432 Get all Pcd Definitions from a package
436 public PcdVector
getAllPcdDeclarationsFromPackage(PackageSurfaceArea spd
) {
437 PcdVector vector
= new PcdVector();
438 if (spd
.getPcdDeclarations() != null) {
439 if (spd
.getPcdDeclarations().getPcdEntryList().size() > 0) {
440 for (int index
= 0; index
< spd
.getPcdDeclarations().getPcdEntryList().size(); index
++) {
441 String name
= spd
.getPcdDeclarations().getPcdEntryList().get(index
).getCName();
442 String guidCName
= spd
.getPcdDeclarations().getPcdEntryList().get(index
).getTokenSpaceGuidCName();
443 String help
= spd
.getPcdDeclarations().getPcdEntryList().get(index
).getHelpText();
444 Vector
<String
> type
= Tools
.convertListToVector(spd
.getPcdDeclarations().getPcdEntryList()
445 .get(index
).getValidUsage());
447 vector
.addPcd(new PcdIdentification(name
, guidCName
, help
, type
));
451 Sort
.sortPcds(vector
, DataType
.SORT_TYPE_ASCENDING
);
455 public Vector
<String
> getAllLibraryClassDefinitionsFromWorkspace() {
456 Vector
<String
> vector
= new Vector
<String
>();
457 for (int index
= 0; index
< GlobalData
.vPackageList
.size(); index
++) {
458 Vector
<String
> v
= getAllLibraryClassDefinitionsFromPackage(GlobalData
.openingPackageList
459 .getPackageSurfaceAreaFromId(GlobalData
.vPackageList
461 if (v
!= null && v
.size() > 0) {
466 Sort
.sortVectorString(vector
, DataType
.SORT_TYPE_ASCENDING
);
470 public Vector
<String
> getAllProtocolDeclarationsFromWorkspace() {
471 Vector
<String
> vector
= new Vector
<String
>();
472 for (int index
= 0; index
< GlobalData
.vPackageList
.size(); index
++) {
473 Vector
<String
> v
= getAllProtocolDeclarationsFromPackage(GlobalData
.openingPackageList
474 .getPackageSurfaceAreaFromId(GlobalData
.vPackageList
476 if (v
!= null && v
.size() > 0) {
480 Sort
.sortVectorString(vector
, DataType
.SORT_TYPE_ASCENDING
);
484 public Vector
<String
> getAllPpiDeclarationsFromWorkspace() {
485 Vector
<String
> vector
= new Vector
<String
>();
486 for (int index
= 0; index
< GlobalData
.vPackageList
.size(); index
++) {
487 Vector
<String
> v
= getAllPpiDeclarationsFromPackage(GlobalData
.openingPackageList
488 .getPackageSurfaceAreaFromId(GlobalData
.vPackageList
490 if (v
!= null && v
.size() > 0) {
494 Sort
.sortVectorString(vector
, DataType
.SORT_TYPE_ASCENDING
);
498 public Vector
<String
> getAllGuidDeclarationsFromWorkspace() {
499 Vector
<String
> vector
= new Vector
<String
>();
500 for (int index
= 0; index
< GlobalData
.vPackageList
.size(); index
++) {
501 Vector
<String
> v
= getAllGuidDeclarationsFromPackage(GlobalData
.openingPackageList
502 .getPackageSurfaceAreaFromId(GlobalData
.vPackageList
504 if (v
!= null && v
.size() > 0) {
509 Sort
.sortVectorString(vector
, DataType
.SORT_TYPE_ASCENDING
);
513 public PcdVector
getAllPcdDeclarationsFromWorkspace() {
514 PcdVector vector
= new PcdVector();
515 for (int index
= 0; index
< GlobalData
.openingPackageList
.size(); index
++) {
516 PcdVector v
= getAllPcdDeclarationsFromPackage(GlobalData
.openingPackageList
517 .getPackageSurfaceAreaFromId(GlobalData
.vPackageList
519 if (v
!= null && v
.size() > 0) {
524 Sort
.sortPcds(vector
, DataType
.SORT_TYPE_ASCENDING
);
529 Find a module's package's id
531 @param id input module id
535 public PackageIdentification
getPackageIdByModuleId(Identification id
) {
536 Vector
<String
> modulePaths
= new Vector
<String
>();
537 Identification mid
= null;
538 String packagePath
= null;
539 String modulePath
= null;
542 // For each package, get all modules list
544 for (int indexI
= 0; indexI
< GlobalData
.vPackageList
.size(); indexI
++) {
545 packagePath
= GlobalData
.vPackageList
.elementAt(indexI
).getPath();
546 modulePaths
= this.getAllModulesOfPackage(packagePath
);
547 for (int indexJ
= 0; indexJ
< modulePaths
.size(); indexJ
++) {
548 modulePath
= modulePaths
.get(indexJ
);
549 mid
= GlobalData
.openingModuleList
.getIdByPath(modulePath
);
553 if (mid
.equals(id
)) {
554 return GlobalData
.vPackageList
.elementAt(indexI
);
564 Add module information to package surface area
572 public void addModuleToPackage(ModuleIdentification mid
, PackageSurfaceArea spd
) throws IOException
, XmlException
,
574 String packagePath
= mid
.getPackageId().getPath();
575 String modulePath
= mid
.getPath();
577 spd
= OpenFile
.openSpdFile(packagePath
);
579 MsaFiles msaFile
= spd
.getMsaFiles();
580 if (msaFile
== null) {
581 msaFile
= MsaFiles
.Factory
.newInstance();
583 packagePath
= packagePath
.substring(0, packagePath
.lastIndexOf(DataType
.FILE_SEPARATOR
));
584 String fn
= Tools
.getRelativePath(modulePath
, packagePath
);
585 msaFile
.addNewFilename();
586 msaFile
.setFilenameArray(msaFile
.getFilenameList().size() - 1, fn
);
587 spd
.setMsaFiles(msaFile
);
588 SaveFile
.saveSpdFile(mid
.getPackageId().getPath(), spd
);
592 Add input package into database
598 public void addPackageToDatabase(PackageIdentification id
) throws Exception
{
599 String path
= id
.getPath();
600 path
= Tools
.getRelativePath(path
, Workspace
.getCurrentWorkspace());
602 DbPathAndFilename filename
= DbPathAndFilename
.Factory
.newInstance();
603 filename
.setStringValue(path
);
604 GlobalData
.fdb
.getPackageList().addNewFilename();
605 GlobalData
.fdb
.getPackageList().setFilenameArray(GlobalData
.fdb
.getPackageList().sizeOfFilenameArray() - 1,
607 String strFrameworkDbFilePath
= Workspace
.getCurrentWorkspace() + Workspace
.getStrWorkspaceDatabaseFile();
608 strFrameworkDbFilePath
= Tools
.convertPathToCurrentOsType(strFrameworkDbFilePath
);
609 SaveFile
.saveDbFile(strFrameworkDbFilePath
, GlobalData
.fdb
);
613 Add input package into database
619 public void addPlatformToDatabase(PlatformIdentification id
) throws Exception
{
620 String path
= id
.getPath();
621 path
= Tools
.getRelativePath(path
, Workspace
.getCurrentWorkspace());
623 DbPathAndFilename filename
= DbPathAndFilename
.Factory
.newInstance();
624 filename
.setStringValue(path
);
625 GlobalData
.fdb
.getPlatformList().addNewFilename();
626 GlobalData
.fdb
.getPlatformList().setFilenameArray(GlobalData
.fdb
.getPlatformList().sizeOfFilenameArray() - 1,
628 String strFrameworkDbFilePath
= Workspace
.getCurrentWorkspace() + Workspace
.getStrWorkspaceDatabaseFile();
629 strFrameworkDbFilePath
= Tools
.convertPathToCurrentOsType(strFrameworkDbFilePath
);
630 SaveFile
.saveDbFile(strFrameworkDbFilePath
, GlobalData
.fdb
);
634 Get all file's path from one module
643 public Vector
<String
> getAllFilesPathOfModule(String path
) {
644 Vector
<String
> v
= new Vector
<String
>();
645 path
= Tools
.convertPathToCurrentOsType(path
);
647 ModuleSurfaceArea msa
= GlobalData
.openingModuleList
648 .getModuleSurfaceAreaFromId(GlobalData
.openingModuleList
652 // Get all files' path of a module
654 SourceFiles sf
= msa
.getSourceFiles();
656 for (int index
= 0; index
< sf
.getFilenameList().size(); index
++) {
657 String temp
= sf
.getFilenameList().get(index
).getStringValue();
658 temp
= Tools
.addFileSeparator(Tools
.getFilePathOnly(path
)) + temp
;
659 v
.addElement(Tools
.convertPathToCurrentOsType(temp
));
668 Get all file's path from one package
677 public Vector
<String
> getAllFilesPathOfPakcage(String path
) {
678 Vector
<String
> v
= new Vector
<String
>();
679 path
= Tools
.convertPathToCurrentOsType(path
);
686 // Add the package's industry std includes one by one
688 Vector
<String
> f1
= new Vector
<String
>();
689 f1
= getAllIndustryStdIncludesOfPackage(path
);
690 for (int index
= 0; index
< f1
.size(); index
++) {
691 v
.addElement(f1
.get(index
));
695 // Add module's files one by one
697 f1
= new Vector
<String
>();
698 f1
= getAllModulesOfPackage(path
);
699 for (int indexI
= 0; indexI
< f1
.size(); indexI
++) {
700 Vector
<String
> f2
= getAllFilesPathOfModule(f1
.get(indexI
));
701 for (int indexJ
= 0; indexJ
< f2
.size(); indexJ
++) {
702 v
.addElement(f2
.get(indexJ
));