summaryrefslogtreecommitdiff
path: root/tools/gnu
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2006-11-29 22:43:35 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2006-11-29 22:43:35 +0000
commit3be294e0e9f07e379e1499b9868db9855eb8726f (patch)
treea1f67d3f1469ecc142b11c30b1e3c2e1a624794d /tools/gnu
parentf40b961c6c82ebc9ae9863635e5fe19c0b07c116 (diff)
downloadclasspath-3be294e0e9f07e379e1499b9868db9855eb8726f.tar.gz
2006-11-29 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of HEAD-->generics for 2006/11/12-2006/11/29.
Diffstat (limited to 'tools/gnu')
-rw-r--r--tools/gnu/classpath/tools/appletviewer/TagParser.java56
-rw-r--r--tools/gnu/classpath/tools/getopt/package.html49
2 files changed, 104 insertions, 1 deletions
diff --git a/tools/gnu/classpath/tools/appletviewer/TagParser.java b/tools/gnu/classpath/tools/appletviewer/TagParser.java
index 68dce97e0..b5bdca70f 100644
--- a/tools/gnu/classpath/tools/appletviewer/TagParser.java
+++ b/tools/gnu/classpath/tools/appletviewer/TagParser.java
@@ -230,12 +230,66 @@ public class TagParser
t.archives = parseArchives(val, t);
val = t.archives.toString();
}
-
+ val = unescapeString(val);
t.parameters.put(key.toLowerCase(), val);
}
}
/**
+ * This method does the same thing as the g_strcompress function in glib.
+ *
+ * @param value
+ * @return value in its original one-byte equivalence.
+ */
+ private static String unescapeString(String value)
+ {
+ String unescVal = "";
+ for (int i = 0; i < value.length(); i++)
+ {
+ if (i == value.length() - 1)
+ {
+ unescVal = unescVal.concat(value.substring(i));
+ break;
+ }
+ if (value.charAt(i) == '\\')
+ {
+ switch (value.charAt(i + 1))
+ {
+ case 'b':
+ unescVal = unescVal.concat("\b");
+ break;
+ case 'f':
+ unescVal = unescVal.concat("\f");
+ break;
+ case 'n':
+ unescVal = unescVal.concat("\n");
+ break;
+ case 'r':
+ unescVal = unescVal.concat("\r");
+ break;
+ case 't':
+ unescVal = unescVal.concat("\t");
+ break;
+ case '\\':
+ unescVal = unescVal.concat("\\");
+ break;
+ case '\"':
+ unescVal = unescVal.concat("\"");
+ break;
+ default:
+ unescVal = unescVal.concat("\\");
+ unescVal = unescVal.concat(value.substring(i + 1, i + 2));
+ break;
+ }
+ i++;
+ }
+ else
+ unescVal = unescVal.concat(value.substring(i, i + 1));
+ }
+ return unescVal;
+ }
+
+ /**
* Parses the archive string and returns a list.
*
* @param the list of archives (comma-separated) in a String.
diff --git a/tools/gnu/classpath/tools/getopt/package.html b/tools/gnu/classpath/tools/getopt/package.html
new file mode 100644
index 000000000..ce6d34a43
--- /dev/null
+++ b/tools/gnu/classpath/tools/getopt/package.html
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!-- package.html - describes classes in java.util package.
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. -->
+
+<html>
+<head><title>GNU Classpath - gnu.classpath.tools.getopt</title></head>
+
+<body>
+<p>This package contains a GNU-style command line option parser. It
+handles short and long options, options with arguments (optionally
+joined to the option text), and a "long option only" mode. It also
+automatically handles <code>--help</code> output. </p>
+
+</body>
+</html>