Class YamlAssetPath
A class representing the path of a member or item of an Asset as it is created/consumed by the YAML asset serializers.
[DataContract]
public sealed class YamlAssetPath
- Inheritance
-
YamlAssetPath
Constructors
YamlAssetPath()
Initializes a new instance of the YamlAssetPath class.
public YamlAssetPath()
YamlAssetPath(IEnumerable<Element>)
Initializes a new instance of the YamlAssetPath class.
public YamlAssetPath(IEnumerable<YamlAssetPath.Element> elements)
Parameters
elementsIEnumerable<YamlAssetPath.Element>The elements constituting this path, in proper order.
Properties
Elements
The elements constituting this path.
[DataMember]
public IReadOnlyList<YamlAssetPath.Element> Elements { get; }
Property Value
Methods
Append(YamlAssetPath)
Appends the given YamlAssetPath to this instance.
[Pure]
public YamlAssetPath Append(YamlAssetPath other)
Parameters
otherYamlAssetPathThe YamlAssetPath
Returns
- YamlAssetPath
A new instance of YamlAssetPath corresonding to the given instance appended to this instance.
Clone()
Creates a clone of this YamlAssetPath instance.
public YamlAssetPath Clone()
Returns
- YamlAssetPath
A new copy of this YamlAssetPath.
FromMemberPath(MemberPath, object)
Creates a YamlAssetPath out of a Stride.Core.Reflection.MemberPath instance.
public static YamlAssetPath FromMemberPath(MemberPath path, object root)
Parameters
pathMemberPathThe Stride.Core.Reflection.MemberPath from which to create a YamlAssetPath.
rootobjectThe root object of the given Stride.Core.Reflection.MemberPath.
Returns
- YamlAssetPath
An instance of YamlAssetPath corresponding to the same target than the given Stride.Core.Reflection.MemberPath.
Match(YamlAssetPath)
Indicates whether the current path represents the same path of another object.
public bool Match(YamlAssetPath other)
Parameters
otherYamlAssetPathAn object to compare with this path.
Returns
- bool
trueif the current path matches theotherparameter; otherwise,false.
Push(Element)
Adds an additional element.
public void Push(YamlAssetPath.Element element)
Parameters
elementYamlAssetPath.ElementThe YamlAssetPath.Element to add.
PushIndex(object)
Adds an additional element to the path representing an access to an item of a collection or a value of a dictionary that does not use ItemId.
public void PushIndex(object index)
Parameters
indexobjectThe index of the item.
- See Also
PushItemId(ItemId)
Adds an additional element to the path representing an access to an item of an collection or a value of a dictionary.
public void PushItemId(ItemId itemId)
Parameters
PushMember(string)
Adds an additional element to the path representing an access to a member of an object.
public void PushMember(string memberName)
Parameters
memberNamestringThe name of the member.
StartsWith(YamlAssetPath)
public bool StartsWith(YamlAssetPath path)
Parameters
pathYamlAssetPath
Returns
ToMemberPath(object)
Convert this YamlAssetPath into a Stride.Core.Reflection.MemberPath.
[Pure]
public MemberPath ToMemberPath(object root)
Parameters
rootobjectThe actual instance that is root of this path.
Returns
- MemberPath
An instance of Stride.Core.Reflection.MemberPath corresponding to the same target than this YamlAssetPath.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.