aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorUbitUmarov2018-01-25 09:06:39 +0000
committerUbitUmarov2018-01-25 09:06:39 +0000
commit98019031dfc8934be2feb92c99c514307b1ca159 (patch)
tree52db021c534ecd48f5a295c29b8debf79bb4ae6b /OpenSim/Framework
parenta few changes to encoder and a few more uses (diff)
downloadopensim-SC-98019031dfc8934be2feb92c99c514307b1ca159.zip
opensim-SC-98019031dfc8934be2feb92c99c514307b1ca159.tar.gz
opensim-SC-98019031dfc8934be2feb92c99c514307b1ca159.tar.bz2
opensim-SC-98019031dfc8934be2feb92c99c514307b1ca159.tar.xz
got tired of creating stringbuilders
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/LLSDxmlEncode.cs18
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++)