Fix http://bugs.xdebug.org/view.php?id=518 and let PHPEclipse works with xdebug 2.1
[phpeclipse.git] / net.sourceforge.phpeclipse.xdebug.core / src / net / sourceforge / phpeclipse / xdebug / php / model / XDebugStringValue.java
1 package net.sourceforge.phpeclipse.xdebug.php.model;
2
3 import net.sourceforge.phpeclipse.xdebug.core.Base64;
4 import net.sourceforge.phpeclipse.xdebug.core.PHPDebugUtils;
5
6 import org.eclipse.debug.core.DebugEvent;
7 import org.eclipse.debug.core.DebugException;
8 import org.w3c.dom.Node;
9
10 public class XDebugStringValue extends XDebugAbstractValue {
11         public XDebugStringValue(XDebugStackFrame variable, Node value) throws DebugException {
12                 super(variable, value);
13
14                 String encoding = PHPDebugUtils.getAttributeValue(value, "encoding");
15                 if (encoding.equals("base64")) {
16                         rowValue = new String(Base64.decode(rowValue));
17                 }
18
19                 setValueString(rowValue);
20         }
21
22         public boolean setValue(String expression) throws DebugException {
23                 setValueString(expression);
24                 fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT));
25                 return true;
26         }
27
28         public boolean supportsValueModification() {
29                 return true;
30         }
31 }