tlang-interperter-cs/tlanglib/TString.cs

29 lines
579 B
C#

using Newtonsoft.Json.Linq;
namespace tlang
{
public class TString : TObject
{
public static implicit operator string(TString s)
{
return s.Value;
}
public string Value {get;set;}
public override bool AsBoolean => Value.Length > 0;
public TString(string text)
{
Value = text;
}
public override string ToString()
{
return Value;
}
public override JToken AsToken()
{
return JValue.FromObject(Value);
}
}
}