diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/LLSDxmlEncode.cs | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/OpenSim/Framework/LLSDxmlEncode.cs b/OpenSim/Framework/LLSDxmlEncode.cs index 5074f05..ac9b468 100644 --- a/OpenSim/Framework/LLSDxmlEncode.cs +++ b/OpenSim/Framework/LLSDxmlEncode.cs | |||
@@ -48,6 +48,8 @@ namespace OpenSim.Framework | |||
48 | sb.Append("<llsd>"); | 48 | sb.Append("<llsd>"); |
49 | } | 49 | } |
50 | 50 | ||
51 | public const string LLSDEmpty = "<llsd><map /></llsd>"; | ||
52 | |||
51 | // got tired of creating a stringbuilder all the time; | 53 | // got tired of creating a stringbuilder all the time; |
52 | public static StringBuilder Start(int size = 256, bool addxmlversion = false) | 54 | public static StringBuilder Start(int size = 256, bool addxmlversion = false) |
53 | { | 55 | { |
@@ -97,6 +99,11 @@ namespace OpenSim.Framework | |||
97 | sb.Append("</array>"); | 99 | sb.Append("</array>"); |
98 | } | 100 | } |
99 | 101 | ||
102 | public static void AddEndMapAndArray(StringBuilder sb) | ||
103 | { | ||
104 | sb.Append("</map></array>"); | ||
105 | } | ||
106 | |||
100 | public static void AddEmptyArray(StringBuilder sb) | 107 | public static void AddEmptyArray(StringBuilder sb) |
101 | { | 108 | { |
102 | sb.Append("<array />"); | 109 | sb.Append("<array />"); |
@@ -386,6 +393,13 @@ namespace OpenSim.Framework | |||
386 | sb.Append("</key><array>"); | 393 | sb.Append("</key><array>"); |
387 | } | 394 | } |
388 | 395 | ||
396 | public static void AddArrayAndMap(string name, StringBuilder sb) | ||
397 | { | ||
398 | sb.Append("<key>"); | ||
399 | sb.Append(name); | ||
400 | sb.Append("</key><array><map>"); | ||
401 | } | ||
402 | |||
389 | public static void AddEmptyArray(string name, StringBuilder sb) | 403 | public static void AddEmptyArray(string name, StringBuilder sb) |
390 | { | 404 | { |
391 | sb.Append("<key>"); | 405 | sb.Append("<key>"); |
@@ -706,7 +720,7 @@ namespace OpenSim.Framework | |||
706 | 720 | ||
707 | public static void AddLLSD(string e, StringBuilder sb) | 721 | public static void AddLLSD(string e, StringBuilder sb) |
708 | { | 722 | { |
709 | sb.Append(e); | 723 | sb.Append(e); |
710 | } | 724 | } |
711 | 725 | ||
712 | public static void EscapeToXML(string s, StringBuilder sb) | 726 | public static void EscapeToXML(string s, StringBuilder sb) |
@@ -746,14 +760,14 @@ namespace OpenSim.Framework | |||
746 | { | 760 | { |
747 | return new byte[8] | 761 | return new byte[8] |
748 | { | 762 | { |
749 | (byte)((uLongValue >> 56) & 0xff), | 763 | (byte)(uLongValue >> 56), |
750 | (byte)((uLongValue >> 48) & 0xff), | 764 | (byte)(uLongValue >> 48), |
751 | (byte)((uLongValue >> 40) & 0xff), | 765 | (byte)(uLongValue >> 40), |
752 | (byte)((uLongValue >> 32) & 0xff), | 766 | (byte)(uLongValue >> 32), |
753 | (byte)((uLongValue >> 24) & 0xff), | 767 | (byte)(uLongValue >> 24), |
754 | (byte)((uLongValue >> 16) & 0xff), | 768 | (byte)(uLongValue >> 16), |
755 | (byte)((uLongValue >> 8) & 0xff), | 769 | (byte)(uLongValue >> 8), |
756 | (byte)(uLongValue & 0xff) | 770 | (byte)uLongValue |
757 | }; | 771 | }; |
758 | } | 772 | } |
759 | 773 | ||
@@ -761,10 +775,10 @@ namespace OpenSim.Framework | |||
761 | { | 775 | { |
762 | return new byte[4] | 776 | return new byte[4] |
763 | { | 777 | { |
764 | (byte)((value >> 24) & 0xff), | 778 | (byte)(value >> 24), |
765 | (byte)((value >> 16) & 0xff), | 779 | (byte)(value >> 16), |
766 | (byte)((value >> 8) & 0xff), | 780 | (byte)(value >> 8), |
767 | (byte)(value & 0xff) | 781 | (byte)value |
768 | }; | 782 | }; |
769 | } | 783 | } |
770 | } | 784 | } |