ln.types/odb/values/ODBStringValue.cs

22 lines
597 B
C#

using System;
using System.Text;
using System.Globalization;
namespace ln.types.odb.values
{
public class ODBStringValue : ODBValue
{
public ODBStringValue(string s)
: base(0x01,s)
{}
public override byte[] GetStorageBytes() => Encoding.UTF8.GetBytes((string)Value);
protected override int compare(ODBEntity other) => ((string)Value).CompareTo((other as ODBValue).Value);
static ODBStringValue()
{
RegisterDeserializer(0x01, (b, o, l) => new ODBStringValue(Encoding.UTF8.GetString(b, o, l)));
}
}
}