]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioProcessor.java
Restructuring for better separation of Tool packages.
[mirror_edk2.git] / Tools / Java / Source / Cpptasks / net / sf / antcontrib / cpptasks / devstudio / DevStudioProcessor.java
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioProcessor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioProcessor.java
new file mode 100644 (file)
index 0000000..6b2af7e
--- /dev/null
@@ -0,0 +1,90 @@
+/*\r
+ * \r
+ * Copyright 2002-2004 The Ant-Contrib project\r
+ *\r
+ *  Licensed under the Apache License, Version 2.0 (the "License");\r
+ *  you may not use this file except in compliance with the License.\r
+ *  You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ *  Unless required by applicable law or agreed to in writing, software\r
+ *  distributed under the License is distributed on an "AS IS" BASIS,\r
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ *  See the License for the specific language governing permissions and\r
+ *  limitations under the License.\r
+ */\r
+package net.sf.antcontrib.cpptasks.devstudio;\r
+import java.util.Vector;\r
+/**\r
+ * A add-in class for Microsoft Developer Studio processors\r
+ * \r
+ *  \r
+ */\r
+public class DevStudioProcessor {\r
+    public static void addWarningSwitch(Vector args, int level) {\r
+        switch (level) {\r
+            case 0 :\r
+                args.addElement("/W0");\r
+                break;\r
+            case 1 :\r
+                args.addElement("/W1");\r
+                break;\r
+            case 2 :\r
+                break;\r
+            case 3 :\r
+                args.addElement("/W3");\r
+                break;\r
+            case 4 :\r
+                args.addElement("/W4");\r
+                break;\r
+            case 5 :\r
+                args.addElement("/WX");\r
+                break;\r
+        }\r
+    }\r
+    public static String getCommandFileSwitch(String cmdFile) {\r
+        StringBuffer buf = new StringBuffer("@");\r
+        if (cmdFile.indexOf(' ') >= 0) {\r
+            buf.append('\"');\r
+            buf.append(cmdFile.replace('/', '\\'));\r
+            buf.append('\"');\r
+        } else {\r
+            buf.append(cmdFile);\r
+        }\r
+        return buf.toString();\r
+    }\r
+    public static void getDefineSwitch(StringBuffer buffer, String define,\r
+            String value) {\r
+        buffer.append("/D");\r
+        buffer.append(define);\r
+        if (value != null && value.length() > 0) {\r
+            buffer.append('=');\r
+            buffer.append(value);\r
+        }\r
+    }\r
+    public static String getIncludeDirSwitch(String includeDir) {\r
+        return "/I" + includeDir.replace('/', '\\');\r
+    }\r
+    public static String[] getOutputFileSwitch(String outPath) {\r
+        StringBuffer buf = new StringBuffer("/Fo");\r
+        if (outPath.indexOf(' ') >= 0) {\r
+            buf.append('\"');\r
+            buf.append(outPath);\r
+            buf.append('\"');\r
+        } else {\r
+            buf.append(outPath);\r
+        }\r
+        String[] retval = new String[]{buf.toString()};\r
+        return retval;\r
+    }\r
+    public static void getUndefineSwitch(StringBuffer buffer, String define) {\r
+        buffer.append("/U");\r
+        buffer.append(define);\r
+    }\r
+    public static boolean isCaseSensitive() {\r
+        return false;\r
+    }\r
+    private DevStudioProcessor() {\r
+    }\r
+}\r