Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ResourceFileName.cs
1using Waher.Script;
6
8{
13 {
22 : base(LocalResource, Start, Length, Expression)
23 {
24 }
25
29 public override string FunctionName => nameof(ResourceFileName);
30
34 public override string[] DefaultArgumentNames => new string[] { "LocalResource" };
35
43 {
44 if (!Gateway.HttpServer.TryGetFileName(Argument, false, out string FileName))
45 throw new ScriptRuntimeException("Unable to convert local resource to file name.", this);
46
47 return new StringValue(FileName);
48 }
49 }
50}
Static class managing the runtime environment of the IoT Gateway.
Definition: Gateway.cs:147
static HttpServer HttpServer
HTTP Server
Definition: Gateway.cs:4118
Returns the file name that corresponds to a local resource, taking into consideration defined web fol...
override string[] DefaultArgumentNames
Default Argument names
ResourceFileName(ScriptNode LocalResource, int Start, int Length, Expression Expression)
Returns the file name that corresponds to a local resource, taking into consideration defined web fol...
override IElement EvaluateScalar(string Argument, Variables Variables)
Evaluates the function.
Class managing a script expression.
Definition: Expression.cs:41
Base class for funcions of one scalar variable.
ScriptNode Argument
Function argument.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:21