diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/LLSDxmlEncode.cs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/OpenSim/Framework/LLSDxmlEncode.cs b/OpenSim/Framework/LLSDxmlEncode.cs index e095363..5447963 100644 --- a/OpenSim/Framework/LLSDxmlEncode.cs +++ b/OpenSim/Framework/LLSDxmlEncode.cs | |||
@@ -48,11 +48,28 @@ namespace OpenSim.Framework | |||
48 | sb.Append("<llsd>"); | 48 | sb.Append("<llsd>"); |
49 | } | 49 | } |
50 | 50 | ||
51 | // got tired of creating a stringbuilder all the time; | ||
52 | public static StringBuilder Start(int size = 256, bool addxmlversion = false) | ||
53 | { | ||
54 | StringBuilder sb = new StringBuilder(size); | ||
55 | if(addxmlversion) | ||
56 | sb.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><llsd>"); // legacy llsd xml name still valid | ||
57 | else | ||
58 | sb.Append("<llsd>"); | ||
59 | return sb; | ||
60 | } | ||
61 | |||
51 | public static void AddEnd(StringBuilder sb) | 62 | public static void AddEnd(StringBuilder sb) |
52 | { | 63 | { |
53 | sb.Append("</llsd>"); | 64 | sb.Append("</llsd>"); |
54 | } | 65 | } |
55 | 66 | ||
67 | public static string End(StringBuilder sb) | ||
68 | { | ||
69 | sb.Append("</llsd>"); | ||
70 | return sb.ToString(); | ||
71 | } | ||
72 | |||
56 | // map == a list of key value pairs | 73 | // map == a list of key value pairs |
57 | public static void AddMap(StringBuilder sb) | 74 | public static void AddMap(StringBuilder sb) |
58 | { | 75 | { |
@@ -452,7 +469,6 @@ namespace OpenSim.Framework | |||
452 | { | 469 | { |
453 | int i; | 470 | int i; |
454 | char c; | 471 | char c; |
455 | String t; | ||
456 | int len = s.Length; | 472 | int len = s.Length; |
457 | 473 | ||
458 | for (i = 0; i < len; i++) | 474 | for (i = 0; i < len; i++) |