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
elements
IEnumerable<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
other
YamlAssetPathThe 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
path
MemberPathThe Stride.Core.Reflection.MemberPath from which to create a YamlAssetPath.
root
objectThe 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
other
YamlAssetPathAn object to compare with this path.
Returns
- bool
true
if the current path matches theother
parameter; otherwise,false
.
Push(Element)
Adds an additional element.
public void Push(YamlAssetPath.Element element)
Parameters
element
YamlAssetPath.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
index
objectThe 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
memberName
stringThe name of the member.
StartsWith(YamlAssetPath)
public bool StartsWith(YamlAssetPath path)
Parameters
path
YamlAssetPath
Returns
ToMemberPath(object)
Convert this YamlAssetPath into a Stride.Core.Reflection.MemberPath.
[Pure]
public MemberPath ToMemberPath(object root)
Parameters
root
objectThe 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.