PathUtilities

DirectoryInfo method extensions.

namespace Sirenix.Utilities
{
[ExtensionAttribute]
public static class PathUtilities
}

Requirements

Namespace: Sirenix.Utilities
Assembly: Sirenix.OdinInspector
Version: 2.0.0.0

Static Methods

Return Type Definition Description
bool CanMakeRelative(string, string) Returns a value indicating whether or not a path can be made relative to another.
string Combine(string, string) Combines two paths, and replaces all backslases with forward slash.
string GetDirectoryName(string) Gets the name of the directory. Always returns forward slash seperators as opposed to Path.GetDirectoryName().
string MakeRelative(string, string) Returns a path string to path that is relative to the parent path.
bool TryMakeRelative(string, string, ref string) Tries to make a path that is relative from parent path to path.

Extension Methods

Return Type Definition Description
DirectoryInfo FindParentDirectoryWithName(this DirectoryInfo, string) Finds a parent directory with a given name, or null if no such parent directory exists.
bool HasSubDirectory(this DirectoryInfo, DirectoryInfo) Determines whether the directory has a given directory in its hierarchy of children.