]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioProcessor.java
Changed spelling to manifest
[mirror_edk2.git] / Tools / Source / Cpptasks / net / sf / antcontrib / cpptasks / devstudio / DevStudioProcessor.java
CommitLineData
878ddf1f 1/*\r
2 * \r
3 * Copyright 2002-2004 The Ant-Contrib project\r
4 *\r
5 * Licensed under the Apache License, Version 2.0 (the "License");\r
6 * you may not use this file except in compliance with the License.\r
7 * You may obtain a copy of the License at\r
8 *\r
9 * http://www.apache.org/licenses/LICENSE-2.0\r
10 *\r
11 * Unless required by applicable law or agreed to in writing, software\r
12 * distributed under the License is distributed on an "AS IS" BASIS,\r
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14 * See the License for the specific language governing permissions and\r
15 * limitations under the License.\r
16 */\r
17package net.sf.antcontrib.cpptasks.devstudio;\r
18import java.util.Vector;\r
19/**\r
20 * A add-in class for Microsoft Developer Studio processors\r
21 * \r
22 * \r
23 */\r
24public class DevStudioProcessor {\r
25 public static void addWarningSwitch(Vector args, int level) {\r
26 switch (level) {\r
27 case 0 :\r
28 args.addElement("/W0");\r
29 break;\r
30 case 1 :\r
31 args.addElement("/W1");\r
32 break;\r
33 case 2 :\r
34 break;\r
35 case 3 :\r
36 args.addElement("/W3");\r
37 break;\r
38 case 4 :\r
39 args.addElement("/W4");\r
40 break;\r
41 case 5 :\r
42 args.addElement("/WX");\r
43 break;\r
44 }\r
45 }\r
46 public static String getCommandFileSwitch(String cmdFile) {\r
47 StringBuffer buf = new StringBuffer("@");\r
48 if (cmdFile.indexOf(' ') >= 0) {\r
49 buf.append('\"');\r
50 buf.append(cmdFile.replace('/', '\\'));\r
51 buf.append('\"');\r
52 } else {\r
53 buf.append(cmdFile);\r
54 }\r
55 return buf.toString();\r
56 }\r
57 public static void getDefineSwitch(StringBuffer buffer, String define,\r
58 String value) {\r
59 buffer.append("/D");\r
60 buffer.append(define);\r
61 if (value != null && value.length() > 0) {\r
62 buffer.append('=');\r
63 buffer.append(value);\r
64 }\r
65 }\r
66 public static String getIncludeDirSwitch(String includeDir) {\r
67 return "/I" + includeDir.replace('/', '\\');\r
68 }\r
69 public static String[] getOutputFileSwitch(String outPath) {\r
70 StringBuffer buf = new StringBuffer("/Fo");\r
71 if (outPath.indexOf(' ') >= 0) {\r
72 buf.append('\"');\r
73 buf.append(outPath);\r
74 buf.append('\"');\r
75 } else {\r
76 buf.append(outPath);\r
77 }\r
78 String[] retval = new String[]{buf.toString()};\r
79 return retval;\r
80 }\r
81 public static void getUndefineSwitch(StringBuffer buffer, String define) {\r
82 buffer.append("/U");\r
83 buffer.append(define);\r
84 }\r
85 public static boolean isCaseSensitive() {\r
86 return false;\r
87 }\r
88 private DevStudioProcessor() {\r
89 }\r
90}\r