aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/mass test client/Parsing.cs
diff options
context:
space:
mode:
authorlbsa712007-06-29 13:51:21 +0000
committerlbsa712007-06-29 13:51:21 +0000
commitf6deaf8a65693d022f58961a007f2492c9ac97fa (patch)
tree7428eccc93a3f64f46e08d7269bc337f3d26d8a8 /tools/mass test client/Parsing.cs
parentDeleted some files that are no longer in use. (I am sure I deleted these yest... (diff)
parent*Hopefully fixed the empty dialog box error on client when logging in on sand... (diff)
downloadopensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.zip
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.gz
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.bz2
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.xz
Switched in NameSpaceChanges
Diffstat (limited to '')
-rw-r--r--tools/mass test client/Parsing.cs61
1 files changed, 0 insertions, 61 deletions
diff --git a/tools/mass test client/Parsing.cs b/tools/mass test client/Parsing.cs
deleted file mode 100644
index 371c3cd..0000000
--- a/tools/mass test client/Parsing.cs
+++ /dev/null
@@ -1,61 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace libsecondlife.TestClient {
6 class Parsing {
7 public static string[] ParseArguments(string str) {
8 List<string> list = new List<string>();
9 string current = "";
10 string trimmed = null;
11 bool withinQuote = false;
12 bool escaped = false;
13 foreach (char c in str) {
14 if (c == '"') {
15 if (escaped) {
16 current += '"';
17 escaped = false;
18 } else {
19 current += '"';
20 withinQuote = !withinQuote;
21 }
22 } else if (c == ' ' || c == '\t') {
23 if (escaped || withinQuote) {
24 current += c;
25 escaped = false;
26 } else {
27 trimmed = current.Trim();
28 if (trimmed.StartsWith("\"") && trimmed.EndsWith("\"")) {
29 trimmed = trimmed.Remove(0, 1);
30 trimmed = trimmed.Remove(trimmed.Length - 1);
31 trimmed = trimmed.Trim();
32 }
33 if (trimmed.Length > 0)
34 list.Add(trimmed);
35 current = "";
36 }
37 } else if (c == '\\') {
38 if (escaped) {
39 current += '\\';
40 escaped = false;
41 } else {
42 escaped = true;
43 }
44 } else {
45 if (escaped)
46 throw new FormatException(c.ToString() + " is not an escapable character.");
47 current += c;
48 }
49 }
50 trimmed = current.Trim();
51 if (trimmed.StartsWith("\"") && trimmed.EndsWith("\"")) {
52 trimmed = trimmed.Remove(0, 1);
53 trimmed = trimmed.Remove(trimmed.Length - 1);
54 trimmed = trimmed.Trim();
55 }
56 if (trimmed.Length > 0)
57 list.Add(trimmed);
58 return list.ToArray();
59 }
60 }
61}