Class FileSystemPath
Utility class for file system path operations.
Namespace: ABB.Robotics.Controllers.FileSystemDomain
Assembly: ABB.Robotics.Controllers.PC.dll
Syntax
public abstract class FileSystemPath
Constructors
FileSystemPath()
Declaration
protected FileSystemPath()
Fields
Backslash
Backslash.
Declaration
public const char Backslash = '\\'
Field Value
Type | Description |
---|---|
Char |
ExtensionSeparator
Extension separator.
Declaration
public const char ExtensionSeparator = '.'
Field Value
Type | Description |
---|---|
Char |
Prefix
Prefix for controller paths.
Declaration
public const string Prefix = "ctrl:"
Field Value
Type | Description |
---|---|
String |
PrefixedSeparator
Prefixed separator.
Declaration
public static readonly string PrefixedSeparator
Field Value
Type | Description |
---|---|
String |
Separator
Separator char.
Declaration
public const char Separator = '/'
Field Value
Type | Description |
---|---|
Char |
SeparatorString
Separator string.
Declaration
public static readonly string SeparatorString
Field Value
Type | Description |
---|---|
String |
Methods
Combine(String, String)
Combines two paths into a new path.
Declaration
public static string Combine(string path1, string path2)
Parameters
Type | Name | Description |
---|---|---|
String | path1 | First part of path. |
String | path2 | Second part of path. |
Returns
Type | Description |
---|---|
String | New path. |
Combine(String, String, String)
Combines three paths into a new path.
Declaration
public static string Combine(string path1, string path2, string path3)
Parameters
Type | Name | Description |
---|---|---|
String | path1 | First part of path. |
String | path2 | Second part of path. |
String | path3 | Third part of path. |
Returns
Type | Description |
---|---|
String | New path. |
EnsureCtrlPathFormat(String)
Prepends the ctrl: prefix to the string if needed and replaces back slash with forward slash
Declaration
public static string EnsureCtrlPathFormat(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | Path to correct. |
Returns
Type | Description |
---|---|
String | A correct path string. |
GetDirectoryPath(String)
Returns the path to the parent direcotory
Declaration
public static string GetDirectoryPath(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | Path to get parent directory from. |
Returns
Type | Description |
---|---|
String | The path to the directory. |
GetExtensionFromPath(String)
Gets the extension of a file, returns an empty string if the file doesn't have an extension
Declaration
public static string GetExtensionFromPath(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | path to get extension from |
Returns
Type | Description |
---|---|
String | the extension of the file |
GetNameFromPath(String)
Returns the name of a file system entry, ie. For a path to a file, it returns the filename and for a path to a directoru it returns the directory name
Declaration
public static string GetNameFromPath(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | path to extract name from |
Returns
Type | Description |
---|---|
String | the name of the entry |