Class PathUtils
Namespace: Aurigma.DesignAtoms.Common
Assembly: Aurigma.DesignAtoms.dll
Syntax
public static class PathUtils
Inheritance: System.Object -> PathUtils
Inherited Members
System.Object.ToStringSystem.Object.Equals(System.Object)System.Object.Equals(System.Object,System.Object)System.Object.ReferenceEquals(System.Object,System.Object)System.Object.GetHashCodeSystem.Object.GetTypeSystem.Object.MemberwiseClone
Methods
ExtractFilePath
public static string ExtractFilePath(string root, string absoluteFilePath, char? separatorChar = null)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | root | |
System.String | absoluteFilePath | |
System.Nullable<System.Char> | separatorChar |
Returns
System.String
AreFoldersMatch
public static bool AreFoldersMatch(DirectoryInfo folder0, DirectoryInfo folder1)
Parameters
| Type | Name | Description |
|---|---|---|
System.IO.DirectoryInfo | folder0 | |
System.IO.DirectoryInfo | folder1 |
Returns
System.Boolean
AreFoldersMatch
public static bool AreFoldersMatch(string path0, string path1)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | path0 | |
System.String | path1 |
Returns
System.Boolean
IsIncludedInRootFolder
public static bool IsIncludedInRootFolder(string selectedFolder, string rootFolder)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | selectedFolder | |
System.String | rootFolder |
Returns
System.Boolean
NormalizePath
public static string NormalizePath(string path)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | path |
Returns
System.String
NormalizePath
public static string NormalizePath(string path, char pathSeparatorChar)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | path | |
System.Char | pathSeparatorChar |
Returns
System.String
IsRootFolder
public static bool IsRootFolder(string path)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | path |
Returns
System.Boolean
GetFolder
public static string GetFolder(string path, char separatorChar)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | path | |
System.Char | separatorChar |
Returns
System.String
GetName
public static string GetName(string path)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | path |
Returns
System.String
ReplaceIllegalChars
public static string ReplaceIllegalChars(string pathPart)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | pathPart |
Returns
System.String
EnsureFolderExists
public static void EnsureFolderExists(string path)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | path |
CleanFolderName
public static string CleanFolderName(string folderName)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | folderName |
Returns
System.String
HasExtension
public static bool HasExtension(string filePath, string extension)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | filePath | |
System.String | extension |
Returns
System.Boolean
RemoveBasePath
public static string RemoveBasePath(string fullPath, string basePath)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | fullPath | |
System.String | basePath |
Returns
System.String