2using System.Collections.Generic;
3using System.Threading.Tasks;
63 if (!(
Argument1.AssociatedObjectValue is
byte[] Bin))
68 return this.DoDecodeAsync(Bin, ContentType,
null);
71 private async Task<IElement> DoDecodeAsync(
byte[] Data,
string ContentType, System.Text.Encoding Encoding)
80 if (Decoded is
string[][] Records)
82 int Rows = Records.Length;
86 foreach (
string[] Rec
in Records)
96 LinkedList<IElement> Elements =
new LinkedList<IElement>();
98 foreach (
string[] Rec
in Records)
104 foreach (
string s
in Rec)
106 if (s is
null ||
string.IsNullOrEmpty(s))
114 else if (TimeSpan.TryParse(s, out TimeSpan TS))
123 while (i++ < MaxCols)
127 return Operators.Matrices.MatrixDefinition.Encapsulate(Elements, Rows, MaxCols,
this);
154 System.Text.Encoding Encoding = System.Text.Encoding.UTF8;
155 byte[] Bin = Encoding.GetBytes(
Argument1);
157 return this.DoDecodeAsync(Bin,
Argument2, Encoding);
Helps with parsing of commong data types.
static bool TryParse(string s, out double Value)
Tries to decode a string encoded double.
Static class managing encoding and decoding of internet content.
static Task< object > DecodeAsync(string ContentType, byte[] Data, Encoding Encoding, KeyValuePair< string, string >[] Fields, Uri BaseUri)
Decodes an object.
Helps with common XML-related tasks.
static bool TryParse(string s, out DateTime Value)
Tries to decode a string encoded DateTime.
Decode(Content,ContentType)
override Task< IElement > EvaluateScalarAsync(string Argument1, string Argument2, Variables Variables)
Evaluates the function on two scalar arguments.
override string FunctionName
Name of the function
override Task< IElement > EvaluateScalarAsync(IElement Argument1, IElement Argument2, Variables Variables)
Evaluates the function on two scalar arguments.
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
override IElement EvaluateScalar(string Argument1, string Argument2, Variables Variables)
Evaluates the function on two scalar arguments.
Decode(ScriptNode Content, ScriptNode ContentType, int Start, int Length, Expression Expression)
Decode(Content,ContentType)
override IElement EvaluateScalar(IElement Argument1, IElement Argument2, Variables Variables)
Evaluates the function on two scalar arguments.
Script runtime exception.
Class managing a script expression.
static IElement Encapsulate(object Value)
Encapsulates an object.
static string ToString(double Value)
Converts a value to a string, that can be parsed as part of an expression.
Base class for funcions of two scalar variables.
ScriptNode Argument2
Function argument 2.
ScriptNode Argument1
Function argument 1.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
int Start
Start position in script expression.
Basic interface for all types of elements.