docs.unity3d.com
    Show / Hide Table of Contents

    Struct CollectionPath

    Represents a path to an element.

    Inherited Members
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Cloud.Assets
    Syntax
    public readonly struct CollectionPath : IEquatable<CollectionPath>, IEquatable<string>

    Constructors

    CollectionPath(String)

    Initializes and returns an instance of CollectionPath

    Declaration
    public CollectionPath(string path)
    Parameters
    Type Name Description
    String path

    A path.

    Properties

    IsEmpty

    Returns whether the path is empty.

    Declaration
    public readonly bool IsEmpty { get; }
    Property Value
    Type Description
    Boolean

    Length

    Returns the length of the path.

    Declaration
    public readonly int Length { get; }
    Property Value
    Type Description
    Int32

    Methods

    BuildPath(String[])

    Creates a string path in the format of a CollectionPath from the given inputs.

    Declaration
    public static string BuildPath(params string[] components)
    Parameters
    Type Name Description
    String[] components

    The individual elements of the path.

    Returns
    Type Description
    String

    A string path combining all inputs.

    CombinePaths(CollectionPath, CollectionPath)

    Creates a new path from the given paths.

    Declaration
    public static CollectionPath CombinePaths(CollectionPath startPath, CollectionPath relativePath)
    Parameters
    Type Name Description
    CollectionPath startPath

    The beginning of the new path.

    CollectionPath relativePath

    The end of the new path.

    Returns
    Type Description
    CollectionPath

    A new CollectionPath that is the combination of the inputs.

    Contains(String)

    Checks whether the path contains the given string.

    Declaration
    public readonly bool Contains(string str)
    Parameters
    Type Name Description
    String str

    A string to verify.

    Returns
    Type Description
    Boolean

    True if the parameter string is contained within the path.

    EndsWith(String)

    Checks whether the path ends with the given string.

    Declaration
    public readonly bool EndsWith(string str)
    Parameters
    Type Name Description
    String str

    A string to verify.

    Returns
    Type Description
    Boolean

    True if the parameter string matches the end of the path.

    Equals(Object)

    Declaration
    public override readonly bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)

    Equals(String)

    Declaration
    public readonly bool Equals(string str)
    Parameters
    Type Name Description
    String str
    Returns
    Type Description
    Boolean
    Implements
    IEquatable<T>.Equals(T)

    Equals(CollectionPath)

    Declaration
    public readonly bool Equals(CollectionPath other)
    Parameters
    Type Name Description
    CollectionPath other
    Returns
    Type Description
    Boolean
    Implements
    IEquatable<T>.Equals(T)

    GetHashCode()

    Declaration
    public override readonly int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()

    GetParentPath(CollectionPath, Int32)

    Trims the path back to the specified parent.

    Declaration
    public static CollectionPath GetParentPath(CollectionPath path, int trimCount = 1)
    Parameters
    Type Name Description
    CollectionPath path

    The path to query.

    Int32 trimCount

    The number of components to trim from the path.

    Returns
    Type Description
    CollectionPath

    A path to a parent.

    GetPathComponents()

    Returns the components of the path.

    Declaration
    public readonly string[] GetPathComponents()
    Returns
    Type Description
    String[]

    An array of string representing every element in the path.

    StartsWith(String)

    Checks whether the path starts with the given string.

    Declaration
    public readonly bool StartsWith(string str)
    Parameters
    Type Name Description
    String str

    A string to verify.

    Returns
    Type Description
    Boolean

    True if the parameter string matches the beginning of the path.

    ToString()

    Declaration
    public override readonly string ToString()
    Returns
    Type Description
    String
    Overrides
    ValueType.ToString()

    Operators

    Equality(CollectionPath, CollectionPath)

    Declaration
    public static bool operator ==(CollectionPath a, CollectionPath b)
    Parameters
    Type Name Description
    CollectionPath a
    CollectionPath b
    Returns
    Type Description
    Boolean

    Implicit(String to CollectionPath)

    Declaration
    public static implicit operator CollectionPath(string a)
    Parameters
    Type Name Description
    String a
    Returns
    Type Description
    CollectionPath

    Implicit(CollectionPath to String)

    Declaration
    public static implicit operator string (CollectionPath a)
    Parameters
    Type Name Description
    CollectionPath a
    Returns
    Type Description
    String

    Inequality(CollectionPath, CollectionPath)

    Declaration
    public static bool operator !=(CollectionPath a, CollectionPath b)
    Parameters
    Type Name Description
    CollectionPath a
    CollectionPath b
    Returns
    Type Description
    Boolean
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023