Adjust code format and remove unused code.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1181 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
wuyizhong
2006-08-03 04:34:39 +00:00
parent a390c35d8a
commit e6225e3c73
5 changed files with 212 additions and 171 deletions

View File

@ -32,23 +32,25 @@ import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project; import org.apache.tools.ant.Project;
/**
*
*/
public class CommandLineUserDefine { public class CommandLineUserDefine {
String includePathDelimiter = null; String includePathDelimiter = null;
String outputDelimiter = null; String outputDelimiter = null;
public void command(CCTask cctask, UserDefineDef userdefine){ public void command(CCTask cctask, UserDefineDef userdefine) {
boolean isGccCommand = userdefine.getFamily().equalsIgnoreCase("GCC"); boolean isGccCommand = userdefine.getFamily().equalsIgnoreCase("GCC");
File workdir; File workdir;
Project project = cctask.getProject(); Project project = cctask.getProject();
if(userdefine.getWorkdir() == null) { if (userdefine.getWorkdir() == null) {
workdir = new File("."); workdir = new File(".");
} } else {
else {
workdir = userdefine.getWorkdir(); workdir = userdefine.getWorkdir();
} }
// //
// generate cmdline= command + args + includepath + endargs + outfile // generate cmdline= command + args + includepath + endargs + outfile
// //
@ -57,15 +59,7 @@ public class CommandLineUserDefine {
Vector endargs = new Vector(); Vector endargs = new Vector();
Vector endargsWithoutSpace = new Vector(); Vector endargsWithoutSpace = new Vector();
Vector includePath = new Vector(); Vector includePath = new Vector();
//
// Generate cmdline = command +
// general args +
// outputflag + outputfile
// includpath +
// endargs +
//
// //
// get Args. // get Args.
// //
@ -77,168 +71,155 @@ public class CommandLineUserDefine {
endargs.addElement(argument[j].getValue()); endargs.addElement(argument[j].getValue());
} }
} }
// //
// get include path. // get include path.
// //
String[] incPath = userdefine.getActiveIncludePaths(); String[] incPath = userdefine.getActiveIncludePaths();
for (int j = 0; j < incPath.length; j++) { for (int j = 0; j < incPath.length; j++) {
if(incPath[j].indexOf(' ') >= 0) { includePath.addElement(includePathDelimiter + incPath[j]);
includePath.addElement( includePathDelimiter + incPath[j]);
//includePath.addElement( includePathDelimiter + "\"" + incPath[j] + "\"");
}
else {
includePath.addElement( includePathDelimiter + incPath[j]);
}
} }
// //
// Remove space in args and endargs. // Remove space in args and endargs.
// //
for ( int i=0; i < args.size(); i++) { for (int i = 0; i < args.size(); i++) {
String str = (String)args.get(i); String str = (String) args.get(i);
StringTokenizer st = new StringTokenizer(str, " \t"); StringTokenizer st = new StringTokenizer(str, " \t");
while(st.hasMoreTokens()) { while (st.hasMoreTokens()) {
argsWithoutSpace.addElement(st.nextToken()); argsWithoutSpace.addElement(st.nextToken());
} }
} }
for ( int i=0; i < endargs.size(); i++) { for (int i = 0; i < endargs.size(); i++) {
String str = (String)endargs.get(i); String str = (String) endargs.get(i);
StringTokenizer st = new StringTokenizer(str, " \t"); StringTokenizer st = new StringTokenizer(str, " \t");
while(st.hasMoreTokens()) { while (st.hasMoreTokens()) {
endargsWithoutSpace.addElement(st.nextToken()); endargsWithoutSpace.addElement(st.nextToken());
} }
} }
int cmdLen = 0; int cmdLen = 0;
// //
// command + args + endargs + includepath + sourcefile // command + args + endargs + includepath + sourcefile
// //
cmdLen = 1 + argsWithoutSpace.size() + endargsWithoutSpace.size() + includePath.size() + 1; cmdLen = 1 + argsWithoutSpace.size() + endargsWithoutSpace.size()
String[] libSet = userdefine.get_libset(); + includePath.size() + 1;
if (libSet != null && libSet.length > 0){ String[] libSet = userdefine.getLibset();
if (libSet != null && libSet.length > 0) {
cmdLen = cmdLen + libSet.length; cmdLen = cmdLen + libSet.length;
if (isGccCommand) { if (isGccCommand) {
cmdLen += 2; // we need -( and -) to group libs for GCC cmdLen += 2; // we need -( and -) to group libs for GCC
} }
} }
// //
// In gcc the "cr" flag should follow space then add outputfile name, otherwise // In gcc the "cr" flag should follow space then add outputfile name,
// it will pop error. // otherwise
// it will pop error.
// TBD // TBD
if (outputDelimiter != null && userdefine.getOutputFile() != null && outputDelimiter.trim().length() > 0){ if (outputDelimiter != null && userdefine.getOutputFile() != null
if (outputDelimiter.trim().equalsIgnoreCase("-cr")){ && outputDelimiter.trim().length() > 0) {
if (outputDelimiter.trim().equalsIgnoreCase("-cr")) {
cmdLen = cmdLen + 2; cmdLen = cmdLen + 2;
}else { } else {
cmdLen++; cmdLen++;
} }
} }
// //
// for every source file // for every source file
// if file is header file, just skip it (add later) // if file is header file, just skip it (add later)
// //
Vector srcSets = userdefine.getSrcSets(); Vector srcSets = userdefine.getSrcSets();
// System.out.println("##" + userdefine.getSrcSets());
// //
// if have source file append source file in command land. // if have source file append source file in command line.
// //
Set allSrcFiles = new LinkedHashSet(); Set allSrcFiles = new LinkedHashSet();
for (int i = 0; i < srcSets.size(); i++) { for (int i = 0; i < srcSets.size(); i++) {
ConditionalFileSet srcSet = (ConditionalFileSet) srcSets ConditionalFileSet srcSet = (ConditionalFileSet) srcSets
.elementAt(i); .elementAt(i);
if (srcSet.isActive()) { if (srcSet.isActive()) {
//
// Find matching source files // Find matching source files
//
DirectoryScanner scanner = srcSet.getDirectoryScanner(project); DirectoryScanner scanner = srcSet.getDirectoryScanner(project);
//
// Check each source file - see if it needs compilation // Check each source file - see if it needs compilation
//
String[] fileNames = scanner.getIncludedFiles(); String[] fileNames = scanner.getIncludedFiles();
for (int j = 0; j < fileNames.length; j++){ for (int j = 0; j < fileNames.length; j++) {
// execute the command
allSrcFiles.add(scanner.getBasedir() + "/" + fileNames[j]); allSrcFiles.add(scanner.getBasedir() + "/" + fileNames[j]);
if (isGccCommand) { if (isGccCommand) {
System.out.println("[" + userdefine.getType() + "] " + fileNames[j]); System.out.println("[" + userdefine.getType() + "] "
+ fileNames[j]);
} }
} }
} }
} }
String[] fileNames = (String[])allSrcFiles.toArray(new String[allSrcFiles.size()]); String[] fileNames = (String[]) allSrcFiles
.toArray(new String[allSrcFiles.size()]);
String[] cmd = new String[cmdLen - 1 + fileNames.length]; String[] cmd = new String[cmdLen - 1 + fileNames.length];
int index = 0; int index = 0;
cmd[index++] = userdefine.getCmd(); cmd[index++] = userdefine.getCmd();
Iterator iter = argsWithoutSpace.iterator(); Iterator iter = argsWithoutSpace.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
cmd[index++] = project.replaceProperties((String)iter.next()); cmd[index++] = project.replaceProperties((String) iter.next());
} }
iter = endargsWithoutSpace.iterator(); iter = endargsWithoutSpace.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
cmd[index++] = project.replaceProperties((String)iter.next()); cmd[index++] = project.replaceProperties((String) iter.next());
} }
// //
// Add outputFileFlag and output file to cmd // Add outputFileFlag and output file to cmd
// //
if (outputDelimiter != null && userdefine.getOutputFile() != null && outputDelimiter.length()> 0){ if (outputDelimiter != null && userdefine.getOutputFile() != null
if (outputDelimiter.trim().equalsIgnoreCase("-cr")){ && outputDelimiter.length() > 0) {
if (outputDelimiter.trim().equalsIgnoreCase("-cr")) {
cmd[index++] = outputDelimiter; cmd[index++] = outputDelimiter;
cmd[index++] = userdefine.getOutputFile(); cmd[index++] = userdefine.getOutputFile();
}else { } else {
cmd[index++] = outputDelimiter + userdefine.getOutputFile(); cmd[index++] = outputDelimiter + userdefine.getOutputFile();
} }
} }
iter = includePath.iterator(); iter = includePath.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
cmd[index++] = (String)iter.next(); cmd[index++] = (String) iter.next();
} }
if (libSet != null && libSet.length > 0){ if (libSet != null && libSet.length > 0) {
if (isGccCommand) { if (isGccCommand) {
cmd[index++] = "-("; cmd[index++] = "-(";
} }
for (int k = 0; k < libSet.length ; k++){ for (int k = 0; k < libSet.length; k++) {
cmd[index++] = libSet[k]; cmd[index++] = libSet[k];
} }
if (isGccCommand) { if (isGccCommand) {
cmd[index++] = "-)"; cmd[index++] = "-)";
} }
} }
for (int j = 0; j < fileNames.length; j++){ for (int j = 0; j < fileNames.length; j++) {
// execute the command
cmd[index++] = fileNames[j]; cmd[index++] = fileNames[j];
} }
int retval = runCommand(cctask, workdir, cmd); int retval = runCommand(cctask, workdir, cmd);
// if with monitor, add more code
if (retval != 0) { if (retval != 0) {
throw new BuildException(userdefine.getCmd() throw new BuildException(userdefine.getCmd()
+ " failed with return code " + retval, + " failed with return code " + retval, cctask
cctask.getLocation()); .getLocation());
} }
} }
protected int runCommand(CCTask task, File workingDir, String[] cmdline) protected int runCommand(CCTask task, File workingDir, String[] cmdline)
throws BuildException { throws BuildException {
return CUtil.runCommand(task, workingDir, cmdline, false, null); return CUtil.runCommand(task, workingDir, cmdline, false, null);
} }
protected String getInputFileArgument(File outputDir, String filename,
int index) {
//
// if there is an embedded space,
// must enclose in quotes
if (filename.indexOf(' ') >= 0) {
StringBuffer buf = new StringBuffer("\"");
buf.append(filename);
buf.append("\"");
return buf.toString();
}
return filename;
}
} }

View File

@ -18,6 +18,10 @@ package net.sf.antcontrib.cpptasks.userdefine;
import net.sf.antcontrib.cpptasks.types.CommandLineArgument; import net.sf.antcontrib.cpptasks.types.CommandLineArgument;
/**
* Collect Arguments.
*
*/
public class UserDefineArgument extends CommandLineArgument { public class UserDefineArgument extends CommandLineArgument {
public UserDefineArgument() { public UserDefineArgument() {

View File

@ -18,24 +18,28 @@ package net.sf.antcontrib.cpptasks.userdefine;
import net.sf.antcontrib.cpptasks.CCTask; import net.sf.antcontrib.cpptasks.CCTask;
/**
* Adapter for the User-Defined Compiler
*/
public class UserDefineCompiler extends CommandLineUserDefine { public class UserDefineCompiler extends CommandLineUserDefine {
public UserDefineCompiler(CCTask cctask, UserDefineDef userdefineDef) { public UserDefineCompiler (CCTask cctask, UserDefineDef userdefineDef) {
String cmdType = userdefineDef.getType(); String cmdType = userdefineDef.getType();
String toolchainFamily = userdefineDef.getFamily(); String toolchainFamily = userdefineDef.getFamily();
UserDefineMapping mapping = new UserDefineMapping();
if (userdefineDef.getIncludePathDelimiter() == null) {
if (userdefineDef.getIncludepathDelimiter() == null) { includePathDelimiter = UserDefineMapping.getIncludePathDelimiter(
includePathDelimiter = mapping.getIncludePathDelimiter(toolchainFamily, cmdType); toolchainFamily, cmdType);
} else { } else {
includePathDelimiter = userdefineDef.getIncludepathDelimiter(); includePathDelimiter = userdefineDef.getIncludePathDelimiter();
} }
if (userdefineDef.getOutputDelimiter() == null) { if (userdefineDef.getOutputDelimiter() == null) {
outputDelimiter = mapping.getOutputFileFlag(toolchainFamily, cmdType); outputDelimiter = UserDefineMapping.getOutputFileFlag(
toolchainFamily, cmdType);
} else { } else {
outputDelimiter = userdefineDef.getOutputDelimiter(); outputDelimiter = userdefineDef.getOutputDelimiter();
} }
} }
} }

View File

@ -32,28 +32,36 @@ import net.sf.antcontrib.cpptasks.types.ConditionalPath;
import net.sf.antcontrib.cpptasks.types.IncludePath; import net.sf.antcontrib.cpptasks.types.IncludePath;
import net.sf.antcontrib.cpptasks.types.LibrarySet; import net.sf.antcontrib.cpptasks.types.LibrarySet;
public class UserDefineDef extends ProcessorDef{ /**
* A userdefinedef definition. userdefine elements may be placed either as
public UserDefineDef () {} * children of a cc element or the project element. A userdefine element with an
* id attribute may be referenced by userdefine elements with refid or extends
* attributes.
*
*/
public class UserDefineDef extends ProcessorDef {
public UserDefineDef () {
}
private String type = "CC"; private String type = "CC";
private String family = "MSFT"; private String family = "MSFT";
private String cmd; private String cmd;
private String includepathDelimiter; private String includePathDelimiter;
private String outputDelimiter; private String outputDelimiter;
private File workdir; private File workdir;
private Vector includePaths= new Vector(); private Vector includePaths = new Vector();
private String outputFile; private String outputFile;
private Vector _libset = new Vector(); private Vector allLibraries = new Vector();
public void addLibset(LibrarySet libset) { public void addLibset(LibrarySet libset) {
if (isReference()) { if (isReference()) {
throw noChildrenAllowed(); throw noChildrenAllowed();
@ -61,31 +69,27 @@ public class UserDefineDef extends ProcessorDef{
if (libset == null) { if (libset == null) {
throw new NullPointerException("libset"); throw new NullPointerException("libset");
} }
_libset.add(libset); allLibraries.add(libset);
} }
public void execute() throws org.apache.tools.ant.BuildException { public void execute() throws org.apache.tools.ant.BuildException {
throw new org.apache.tools.ant.BuildException( throw new org.apache.tools.ant.BuildException(
"Not an actual task, but looks like one for documentation purposes"); "Not an actual task, but looks like one for documentation purposes");
} }
public void addConfiguredArgument(UserDefineArgument arg) { public void addConfiguredArgument(UserDefineArgument arg) {
if (isReference()) { if (isReference()) {
throw noChildrenAllowed(); throw noChildrenAllowed();
} }
addConfiguredProcessorArg(arg); addConfiguredProcessorArg(arg);
} }
/** /**
* Creates an include path. * Creates an include path.
*/ */
public IncludePath createIncludePath() { public IncludePath createIncludePath() {
Project p = getProject(); Project p = getProject();
if (p == null) {
throw new java.lang.IllegalStateException("project must be set");
}
if (isReference()) { if (isReference()) {
throw noChildrenAllowed(); throw noChildrenAllowed();
} }
@ -93,11 +97,14 @@ public class UserDefineDef extends ProcessorDef{
includePaths.addElement(path); includePaths.addElement(path);
return path; return path;
} }
/** /**
* Add a <includepath> if specify the file attribute * Add a <includepath> if specify the file attribute
* *
* @param activePath
* Active Path Vector
* @param file
* File with multiple path
* @throws BuildException * @throws BuildException
* if the specify file not exist * if the specify file not exist
*/ */
@ -112,7 +119,7 @@ public class UserDefineDef extends ProcessorDef{
fileReader = new FileReader(file); fileReader = new FileReader(file);
in = new BufferedReader(fileReader); in = new BufferedReader(fileReader);
while ((str = in.readLine()) != null) { while ((str = in.readLine()) != null) {
if (str.trim() == "") { if (str.trim().endsWith("")) {
continue; continue;
} }
str = getProject().replaceProperties(str); str = getProject().replaceProperties(str);
@ -122,9 +129,11 @@ public class UserDefineDef extends ProcessorDef{
throw new BuildException(e.getMessage()); throw new BuildException(e.getMessage());
} }
} }
/** /**
* Returns the specific include path. * Returns the specific include path.
*
* @return All active include paths
*/ */
public String[] getActiveIncludePaths() { public String[] getActiveIncludePaths() {
if (isReference()) { if (isReference()) {
@ -133,14 +142,12 @@ public class UserDefineDef extends ProcessorDef{
} }
return getActivePaths(includePaths); return getActivePaths(includePaths);
} }
private String[] getActivePaths(Vector paths) { private String[] getActivePaths(Vector paths) {
Project p = getProject(); Project p = getProject();
if (p == null) {
throw new java.lang.IllegalStateException("project not set");
}
Vector activePaths = new Vector(paths.size()); Vector activePaths = new Vector(paths.size());
for (int i = 0; i < paths.size(); i++) { int length = paths.size();
for (int i = 0; i < length; i++) {
ConditionalPath path = (ConditionalPath) paths.elementAt(i); ConditionalPath path = (ConditionalPath) paths.elementAt(i);
if (path.isActive(p)) { if (path.isActive(p)) {
if (path.getFile() == null) { if (path.getFile() == null) {
@ -157,22 +164,38 @@ public class UserDefineDef extends ProcessorDef{
activePaths.copyInto(pathNames); activePaths.copyInto(pathNames);
return pathNames; return pathNames;
} }
public String getIncludepathDelimiter() { /**
* Get include path delimiter.
*
* @return Include Path Delimiter
*/
public String getIncludePathDelimiter() {
if (isReference()) { if (isReference()) {
return ((UserDefineDef) getCheckedRef(UserDefineDef.class, return ((UserDefineDef) getCheckedRef(UserDefineDef.class,
"UserDefineDef")).getIncludepathDelimiter(); "UserDefineDef")).getIncludePathDelimiter();
} }
return includepathDelimiter; return includePathDelimiter;
} }
public void setIncludepathDelimiter(String includepathDelimiter) { /**
* Set include path delimiter.
*
* @param includePathDelimiter
* include path delimiter
*/
public void setIncludePathDelimiter(String includePathDelimiter) {
if (isReference()) { if (isReference()) {
throw tooManyAttributes(); throw tooManyAttributes();
} }
this.includepathDelimiter = includepathDelimiter; this.includePathDelimiter = includePathDelimiter;
} }
/**
* Get type.
*
* @return type
*/
public String getType() { public String getType() {
if (isReference()) { if (isReference()) {
return ((UserDefineDef) getCheckedRef(UserDefineDef.class, return ((UserDefineDef) getCheckedRef(UserDefineDef.class,
@ -181,6 +204,12 @@ public class UserDefineDef extends ProcessorDef{
return type; return type;
} }
/**
* Set type.
*
* @param type
* Type
*/
public void setType(String type) { public void setType(String type) {
if (isReference()) { if (isReference()) {
throw tooManyAttributes(); throw tooManyAttributes();
@ -232,29 +261,28 @@ public class UserDefineDef extends ProcessorDef{
this.workdir = workdir; this.workdir = workdir;
} }
public String[] get_libset() { public String[] getLibset() {
Set libs = new LinkedHashSet(); Set libs = new LinkedHashSet();
Iterator iter = _libset.iterator(); Iterator iter = allLibraries.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
LibrarySet librarySet = (LibrarySet)iter.next(); LibrarySet librarySet = (LibrarySet) iter.next();
File basedir = librarySet.getDir(getProject()); File basedir = librarySet.getDir(getProject());
String[] libStrArray = librarySet.getLibs(); String[] libStrArray = librarySet.getLibs();
for (int i = 0 ; i < libStrArray.length; i ++) { for (int i = 0; i < libStrArray.length; i++) {
if (basedir != null) { if (basedir != null) {
File libFile = new File(libStrArray[i]); File libFile = new File(libStrArray[i]);
if (libFile.isAbsolute()) { if (libFile.isAbsolute()) {
libs.add(libFile.getPath()); libs.add(libFile.getPath());
} else {
libs.add(basedir.getPath() + File.separatorChar
+ libFile.getPath());
} }
else { } else {
libs.add(basedir.getPath() + File.separatorChar + libFile.getPath());
}
}
else {
libs.add(libStrArray[i]); libs.add(libStrArray[i]);
} }
} }
} }
return (String[])libs.toArray(new String[libs.size()]); return (String[]) libs.toArray(new String[libs.size()]);
} }
public String getOutputDelimiter() { public String getOutputDelimiter() {

View File

@ -15,32 +15,47 @@
* limitations under the License. * limitations under the License.
*/ */
package net.sf.antcontrib.cpptasks.userdefine; package net.sf.antcontrib.cpptasks.userdefine;
/**
* Relationship between {family, command type} and flags
*
*/
public class UserDefineMapping { public class UserDefineMapping {
/**
* Mapping info: include path delimiter <--> family (vendor) + command type
*/
public static final String[][] includePathFlag = { { "MSFT_CC", "/I" },
{ "GCC_CC", "-I" }, { "INTEL_CC", "/I" },
{ "WINDDK_CC", "/I" }, { "MSFT_ASM", "/I" },
{ "GCC_ASM", "-I" }, { "WINDDK_CC", "/I" },
{ "MSFT_PP", "/I" }, { "GCC_PP", "-I" },
{ "WINDDK_PP", "/I" } };
// list of Vendor: Microsoft, Intel, Gcc /**
public final String[] families = { "MSFT", "INTEL", "GCC"}; * Mapping info: output file flag <--> family (vendor) + command type
*/
public static final String[][] outputFileFlag = { { "MSFT_CC", "/Fo" },
{ "GCC_CC", "-o" }, { "INTEL_CC", "/Fo" },
{ "WINDDK_CC", "/Fo" }, { "MSFT_SLINK", "/OUT:" },
{ "GCC_SLINK", "-cr" }, { "INTEL_SLINK", "/OUT:" },
{ "WINDDK_SLINK", "/OUT:" }, { "MSFT_DLINK", "/OUT:" },
{ "GCC_DLINK", "-o" }, { "INTEL_DLINK", "/OUT:" },
{ "WINDDK_DLINK", "/OUT:" }, { "MSFT_ASM", "/Fo" },
{ "GCC_ASM", "-o" }, { "WINDDK_ASM", "/Fo" },
{ "WINDDK_IPF_ASM", "-o" } };
// list of Command Type: CC, SLINK, DLINK, ASL, ASM, ASMLINK, PP /**
public final String[] commandType = { "CC", "SLINK", "DLINK", "ASL", * Get include delimiter with vendow and command type.
"ASM", "ASMLINK", "PP" }; *
* @param vendor
public final String[][] includePathFlag = { { "MSFT_CC", "/I" }, * Vendor
{ "GCC_CC", "-I" }, { "INTEL_CC", "/I" }, { "WINDDK_CC", "/I" }, * @param commandType
{ "MSFT_ASM", "/I" }, { "GCC_ASM", "-I" }, { "WINDDK_CC", "/I" }, * Command Type
{ "MSFT_PP", "/I" }, { "GCC_PP", "-I" }, { "WINDDK_PP", "/I" } }; * @return include path delimiter
*/
public final String[][] outputFileFlag = { { "MSFT_CC", "/Fo" }, public static String getIncludePathDelimiter(String vendor,
{ "GCC_CC", "-o" }, { "INTEL_CC", "/Fo" }, { "WINDDK_CC", "/Fo" }, String commandType) {
{ "MSFT_SLINK", "/OUT:" }, { "GCC_SLINK", "-cr" },
{ "INTEL_SLINK", "/OUT:" }, { "WINDDK_SLINK", "/OUT:" },
{ "MSFT_DLINK", "/OUT:" }, { "GCC_DLINK", "-o" },
{ "INTEL_DLINK", "/OUT:" }, { "WINDDK_DLINK", "/OUT:" },
{ "MSFT_ASM", "/Fo" }, { "GCC_ASM", "-o" },
{ "WINDDK_ASM", "/Fo" },{"WINDDK_IPF_ASM", "-o"} };
public String getIncludePathDelimiter(String vendor,
String commandType) {
String key = vendor + "_" + commandType; String key = vendor + "_" + commandType;
for (int i = 0; i < includePathFlag.length; i++) { for (int i = 0; i < includePathFlag.length; i++) {
if (includePathFlag[i][0].equalsIgnoreCase(key)) { if (includePathFlag[i][0].equalsIgnoreCase(key)) {
@ -50,7 +65,16 @@ public class UserDefineMapping {
return "/I"; return "/I";
} }
public String getOutputFileFlag(String vendor, String commandType) { /**
* Get Output Flag with vendor and command type.
*
* @param vendor
* Vendor
* @param commandType
* Command Type
* @return Output File Flag
*/
public static String getOutputFileFlag(String vendor, String commandType) {
String key = vendor + "_" + commandType; String key = vendor + "_" + commandType;
for (int i = 0; i < outputFileFlag.length; i++) { for (int i = 0; i < outputFileFlag.length; i++) {
if (outputFileFlag[i][0].equalsIgnoreCase(key)) { if (outputFileFlag[i][0].equalsIgnoreCase(key)) {