Skip to content

API Host ScriptSourceReference

Liu.Yandong.Hanks edited this page Aug 26, 2026 · 6 revisions

ScriptSourceReference

已解析的源引用,其规范化的 FullPath 是编译器和运行时模块标识。

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

返回 .NET 宿主 API 参考

概述

Source Resolver 在解析入口、import 或 include 后返回此值。FullPath 在整个编译和运行时注册中标识源;ModulePath 是解析器相对显示/源信息,不是 @module 名称。

快速参考

ScriptSourceReference 的最小用法。

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

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

构造函数

ScriptSourceReference(string baseDirectory, string fullPath)

创建 ScriptSourceReference 实例。

ScriptSourceReference(string baseDirectory, string fullPath)

参数

名称 类型 必需 说明
baseDirectory string 与源引用关联的解析器根。
fullPath string 规范化的绝对路径或虚拟源标识符。

返回值

新的 ScriptSourceReference 实例。

ScriptSourceReference(string baseDirectory, string fullPath, string modulePath)

创建 ScriptSourceReference 实例。

ScriptSourceReference(string baseDirectory, string fullPath, string modulePath)

参数

名称 类型 必需 说明
baseDirectory string 与源引用关联的解析器根。
fullPath string 规范化的绝对路径或虚拟源标识符。
modulePath string 用于显示和源相对行为的解析器相对源路径。不是模块名称或标识。

返回值

新的 ScriptSourceReference 实例。

属性

BaseDirectory

应读取此引用的解析器根。

string BaseDirectory

参数

无。

返回值

返回 string

FullPath

规范化的绝对文件路径或虚拟源标识符。

string FullPath

参数

无。

返回值

返回 string

ModulePath

用于显示和源相对行为的解析器相对源路径。不是模块名称或注册表标识。

string ModulePath

参数

无。

返回值

返回 string

Clone this wiki locally