Pull LLSD-XML OSD type from Ubit omv

This commit is contained in:
Cinder
2019-10-04 08:32:44 -05:00
parent 580a0fd56e
commit 92a7e8051e
2 changed files with 78 additions and 33 deletions

View File

@@ -34,7 +34,7 @@ using System.Text;
namespace OpenMetaverse.StructuredData
{
public enum OSDType
public enum OSDType : byte
{
Unknown,
Boolean,
@@ -46,7 +46,8 @@ namespace OpenMetaverse.StructuredData
URI,
Binary,
Map,
Array
Array,
LlsdXml
}
public enum OSDFormat
@@ -553,6 +554,27 @@ namespace OpenMetaverse.StructuredData
public override string ToString() { return AsString(); }
}
/// <summary>
/// OSD LLSD-XML Element
/// </summary>
public sealed class OSDLlsdXml : OSD
{
public readonly string value;
public override OSDType Type => OSDType.LlsdXml;
public override OSD Copy() { return new OSDLlsdXml(value); }
public OSDLlsdXml(string value)
{
// Refuse to hold null pointers
this.value = value ?? string.Empty;
}
public override string AsString() { return value; }
public override byte[] AsBinary() { return Encoding.UTF8.GetBytes(value); }
public override string ToString() { return AsString(); }
}
/// <summary>
/// OSD String Element
/// </summary>