ResourceUID

package
v0.0.0-...-c909628 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package ResourceUID provides methods for working with ResourceUID object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddId

func AddId(id int, path string)

Adds a new UID value which is mapped to the given resource path. Fails with an error if the UID already exists, so be sure to check [method has_id] beforehand, or use [method set_id] instead.

func Advanced

func Advanced() class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

func CreateId

func CreateId() int

Generates a random resource UID which is guaranteed to be unique within the list of currently loaded UIDs. In order for this UID to be registered, you must call [method add_id] or [method set_id].

func GetIdPath

func GetIdPath(id int) string

Returns the path that the given UID value refers to. Fails with an error if the UID does not exist, so be sure to check [method has_id] beforehand.

func HasId

func HasId(id int) bool

Returns whether the given UID value is known to the cache.

func IdToText

func IdToText(id int) string

Converts the given UID to a [code]uid://[/code] string value.

func RemoveId

func RemoveId(id int)

Removes a loaded UID value from the cache. Fails with an error if the UID does not exist, so be sure to check [method has_id] beforehand.

func SetId

func SetId(id int, path string)

Updates the resource path of an existing UID. Fails with an error if the UID does not exist, so be sure to check [method has_id] beforehand, or use [method add_id] instead.

func TextToId

func TextToId(text_id string) int

Extracts the UID value from the given [code]uid://[/code] string.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL