Browse Source

clean simplejson

tags/2.3
clowwindy 10 years ago
parent
commit
456bffc76c
1 changed files with 0 additions and 61 deletions
  1. +0
    -61
      shadowsocks-csharp/3rd/SimpleJson.cs

+ 0
- 61
shadowsocks-csharp/3rd/SimpleJson.cs View File

@@ -589,67 +589,6 @@ namespace SimpleJson
return SerializeObject(json, CurrentJsonSerializerStrategy);
}
public static string EscapeToJavascriptString(string jsonString)
{
if (string.IsNullOrEmpty(jsonString))
{
return jsonString;
}
StringBuilder sb = new StringBuilder();
char c;
for (int i = 0; i < jsonString.Length; )
{
c = jsonString[i++];
if (c == '\\')
{
int remainingLength = jsonString.Length - i;
if (remainingLength >= 2)
{
char lookahead = jsonString[i];
if (lookahead == '\\')
{
sb.Append('\\');
++i;
}
else if (lookahead == '"')
{
sb.Append("\"");
++i;
}
else if (lookahead == 't')
{
sb.Append('\t');
++i;
}
else if (lookahead == 'b')
{
sb.Append('\b');
++i;
}
else if (lookahead == 'n')
{
sb.Append('\n');
++i;
}
else if (lookahead == 'r')
{
sb.Append('\r');
++i;
}
}
}
else
{
sb.Append(c);
}
}
return sb.ToString();
}
protected static IDictionary<string, object> ParseObject(char[] json, ref int index, ref bool success)
{
IDictionary<string, object> table = new JsonObject();


Loading…
Cancel
Save