Skip to content

API Host ScriptSourceReference

Liu.Yandong.Hanks edited this page Aug 19, 2026 · 3 revisions

ScriptSourceReference

Resolver 成功解析 import/include 路径后返回的稳定来源标识。

Stable identity returned by a resolver after an import/include path is resolved.

命名空间:AuroraScript.Core。类型:struct。

Namespace: AuroraScript.Core. Kind: struct.

返回 .NET Host API 参考

Back to .NET Host API Reference

用途

Purpose

ScriptSourceReference 是公开宿主类型。通过下方签名选择调用方式;对运行时对象、生命周期和异常,应由宿主在边界处明确处理。

Stable identity returned by a resolver after an import/include path is resolved.

简单示例

Simple Example

下面是 ScriptSourceReference 的最小使用方式。

A minimal use of ScriptSourceReference.

var reference = new ScriptSourceReference(
    "mem://app/",
    "main.as");

Console.WriteLine(reference.FullPath); // mem://app/main.as

成员

Members

Constructor

签名

  • ScriptSourceReference(string baseDirectory, string fullPath)
  • ScriptSourceReference(string baseDirectory, string fullPath, string modulePath)

创建 ScriptSourceReference 实例。

Use the member according to its public signature.

Parameters:

  • baseDirectory
    来源所属的 Resolver 根目录。

    Resolver root directory owning the source.

  • fullPath
    来源的规范化完整路径。

    Normalized full path of the source.

  • modulePath
    按签名提供的 string 参数。

    The string parameter required by the signature.

Returns

新建的 ScriptSourceReference 实例。

A new ScriptSourceReference instance.

调用示意

以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。

The example shows the call shape; replace placeholder instances and arguments with actual host values.

var value = new ScriptSourceReference(/* 参数 */);

string BaseDirectory

读取 BaseDirectory 属性。

Resolver root that should read this reference.

Parameters:

  • 无。

    None.

Returns

返回 string

Returns string.

调用示意

以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。

The example shows the call shape; replace placeholder instances and arguments with actual host values.

ScriptSourceReference value = /* 从宿主 API 获取实例 */;
var current = value.BaseDirectory;

string FullPath

读取 FullPath 属性。

Normalized absolute file path or virtual source identifier.

Parameters:

  • 无。

    None.

Returns

返回 string

Returns string.

调用示意

以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。

The example shows the call shape; replace placeholder instances and arguments with actual host values.

ScriptSourceReference value = /* 从宿主 API 获取实例 */;
var current = value.FullPath;

string ModulePath

读取 ModulePath 属性。

Module-relative path used by compiler/runtime names.

Parameters:

  • 无。

    None.

Returns

返回 string

Returns string.

调用示意

以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。

The example shows the call shape; replace placeholder instances and arguments with actual host values.

ScriptSourceReference value = /* 从宿主 API 获取实例 */;
var current = value.ModulePath;

Clone this wiki locally