Struct CollectionPath
Represents a path to an element.
Assembly: Unity.Cloud.Assets.dll
Syntax
public readonly struct CollectionPath : IEquatable<CollectionPath>, IEquatable<string>
Constructors
CollectionPath(string)
Declaration
public CollectionPath(string path)
Parameters
Type |
Name |
Description |
string |
path |
A path.
|
Properties
IsEmpty
Returns whether the path is empty.
Declaration
public bool IsEmpty { get; }
Property Value
Length
Returns the length of the path.
Declaration
public int Length { get; }
Property Value
Methods
BuildPath(params 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
Returns
Contains(string)
Checks whether the path contains the given string.
Declaration
public bool Contains(string str)
Parameters
Type |
Name |
Description |
string |
str |
A string to verify.
|
Returns
Type |
Description |
bool |
True if the parameter string is contained within the path.
|
EndsWith(string)
Checks whether the path ends with the given string.
Declaration
public bool EndsWith(string str)
Parameters
Type |
Name |
Description |
string |
str |
A string to verify.
|
Returns
Type |
Description |
bool |
True if the parameter string matches the end of the path.
|
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
Equals(string)
Declaration
public bool Equals(string str)
Parameters
Type |
Name |
Description |
string |
str |
|
Returns
Equals(CollectionPath)
Declaration
public bool Equals(CollectionPath other)
Parameters
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
GetPathComponents()
Returns the components of the path.
Declaration
public 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 bool StartsWith(string str)
Parameters
Type |
Name |
Description |
string |
str |
A string to verify.
|
Returns
Type |
Description |
bool |
True if the parameter string matches the beginning of the path.
|
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
operator ==(CollectionPath, CollectionPath)
Declaration
public static bool operator ==(CollectionPath a, CollectionPath b)
Parameters
Returns
implicit operator CollectionPath(string)
Declaration
public static implicit operator CollectionPath(string a)
Parameters
Type |
Name |
Description |
string |
a |
|
Returns
implicit operator string(CollectionPath)
Declaration
public static implicit operator string(CollectionPath a)
Parameters
Returns
operator !=(CollectionPath, CollectionPath)
Declaration
public static bool operator !=(CollectionPath a, CollectionPath b)
Parameters
Returns
Implements
Extension Methods