3using System.Threading.Tasks;
69 if (!(
Argument1.AssociatedObjectValue is
byte[] Bin))
74 return this.DoDecodeAsync(Bin, ContentType,
null);
77 private async Task<IElement> DoDecodeAsync(
byte[] Data,
string ContentType,
System.Text.Encoding Encoding)
89 if (Content.
Decoded is
string[][] Records)
91 int Rows = Records.Length;
95 foreach (
string[] Rec
in Records)
107 foreach (
string[] Rec
in Records)
113 foreach (
string s
in Rec)
115 if (s is
null ||
string.IsNullOrEmpty(s))
123 else if (TimeSpan.TryParse(s, out TimeSpan TS))
132 while (i++ < MaxCols)
136 return Operators.Matrices.MatrixDefinition.Encapsulate(Elements, Rows, MaxCols,
this);
163 System.Text.Encoding Encoding =
System.Text.Encoding.UTF8;
164 byte[] Bin = Encoding.GetBytes(
Argument1);
166 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.
Contains information about a response to a content request.
bool HasError
If an error occurred.
object Decoded
Decoded object.
Exception Error
Error response.
Static class managing encoding and decoding of internet content.
static Task< ContentResponse > 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.
A chunked list is a linked list of chunks of objects of type T .
void Add(T Item)
Adds an item to the collection.
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.
override bool UpgradeScalarsToSameSet
If scalars should be upgraded to the same set before evaluation.
Exception thrown if binary data is expected.
Script runtime exception.
Class managing a script expression.
static IElement Encapsulate(object Value)
Encapsulates an object.
static string ToExpressionString(object Value)
Converts an object 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.
static readonly ObjectValue Null
Null value.
Basic interface for all types of elements.