Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinMIEnvironmentCD.java')
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinMIEnvironmentCD.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinMIEnvironmentCD.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinMIEnvironmentCD.java
new file mode 100644
index 00000000000..f0ee90b1849
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/factories/win32/WinMIEnvironmentCD.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.mi.core.command.factories.win32;
+
+import org.eclipse.cdt.debug.mi.core.command.MIEnvironmentCD;
+
+/**
+ * Comment for .
+ */
+public class WinMIEnvironmentCD extends MIEnvironmentCD {
+
+ public WinMIEnvironmentCD( String miVersion, String path ) {
+ super( miVersion, path );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.mi.core.command.MICommand#parametersToString()
+ */
+ protected String parametersToString() {
+ String[] params = getParameters();
+ if ( params != null && params.length == 1 ) {
+ StringBuffer sb = new StringBuffer();
+ // We need to escape the double quotes and the backslash.
+ String param = params[0];
+ for( int j = 0; j < param.length(); j++ ) {
+ char c = param.charAt( j );
+ if ( c == '"' || c == '\\' ) {
+ sb.append( '\\' );
+ }
+ sb.append( c );
+ }
+ // If the string contains spaces instead of escaping
+ // surround the parameter with double quotes.
+ if ( containsWhitespace( param ) ) {
+ sb.insert( 0, '"' );
+ sb.append( '"' );
+ }
+ return sb.toString().trim();
+ }
+ return super.parametersToString();
+ }
+}

Back to the top