Skip to main content

Class MetaFilePathUtil

Namespace: Workspace.XBR.Xperiflow.MetaFileSystem

Assembly: Xperiflow.dll

Declaration
public static class MetaFilePathUtil

Methods

JoinParentAndName(string, string, bool)

Joins a parent and name with a joiner.

Declaration
public static string JoinParentAndName(string parent, string name, bool asPosix = true)
Returns

System.String

The joined parent and name.

Parameters
TypeNameDescription
System.StringparentThe parent to join.
System.StringnameThe name to join.
System.BooleanasPosix

PathAsPosix(string)

Returns the path in posix format (forward slashes). This ensures that all paths are used with forward slashes.

Declaration
public static string PathAsPosix(string path)
Returns

System.String

The path as posix.

Parameters
TypeNameDescription
System.StringpathThe path to convert.

PathAsWindows(string)

Returns the path in windows format (backward slashes). This ensures that all paths are used with backward slashes.

Declaration
public static string PathAsWindows(string path)
Returns

System.String

Parameters
TypeName
System.Stringpath

SanitizePath(string, bool)

Removes any duplicate slashes from the path and standardizes the path to have consistent slashes based on the asPosix parameter.

Declaration
public static string SanitizePath(string path, bool asPosix = true)
Returns

System.String

Parameters
TypeName
System.Stringpath
System.BooleanasPosix

GetPathParent(string, bool)

Returns the parent of a path.

Declaration
public static string GetPathParent(string path, bool asPosix = true)
Returns

System.String

The parent of the path.

Parameters
TypeNameDescription
System.StringpathThe path to get the parent of.
System.BooleanasPosixWhether to return the path as posix.

GetPathName(string)

Returns the last part of the path.

Declaration
public static string GetPathName(string path)
Returns

System.String

The last portion of the path.

Parameters
TypeNameDescription
System.StringpathThe path to get the name of.

GetPathParentAndName(string, bool)

Returns the parent and name of a path.

Declaration
public static (string, string) GetPathParentAndName(string path, bool asPosix = true)
Returns

System.ValueTuple<System.String,System.String>

The parent and name of the path.

Parameters
TypeNameDescription
System.StringpathThe path to get the parent and name of.
System.BooleanasPosixWhether to return the path as posix.

JoinPathParts(bool, params string[])

Joins paths together.

Declaration
public static string JoinPathParts(bool asPosix = true, params string[] pathParts)
Returns

System.String

The joined paths.

Parameters
TypeNameDescription
System.BooleanasPosixWhether to format the joined path as POSIX, using forward slashes. Defaults to true. False will return windows paths.
System.String[]pathPartsThe paths to join.

GetPathExtendedSuffix(string, bool)

Returns the extension of a path, including compound extensions.

Declaration
public static string GetPathExtendedSuffix(string path, bool includePeriod = true)
Returns

System.String

The extension of the path.

Parameters
TypeNameDescription
System.StringpathThe path to get the extension of.
System.BooleanincludePeriodWhether to include the leading period in the returned extension.

GetPathParts(string, bool)

Returns the parts of a path.

Declaration
public static string[] GetPathParts(string path, bool asPosix = true)
Returns

System.String[]

The parts of the path.

Parameters
TypeNameDescription
System.StringpathThe path to get the parts of.
System.BooleanasPosixWhether to return the path as posix. Defaults to true.

GetRelativePath(string, string, bool)

Gets the relative path from a full path to a root path, with an option to format as POSIX.

Declaration
public static string GetRelativePath(string fullPath, string rootPath, bool asPosix = true)
Returns

System.String

The relative path from the root path to the full path.

Parameters
TypeNameDescription
System.StringfullPathThe full path to get the relative path from.
System.StringrootPathThe root path to calculate the relative path to.
System.BooleanasPosixWhether to return the path in POSIX format. Default is true.
Exceptions

OneStream.Shared.Common.XFException Thrown when the fullPath does not contain the rootPath.

Inherited Members

  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object,System.Object)
  • System.Object.GetHashCode
  • System.Object.GetType
  • System.Object.MemberwiseClone
  • System.Object.ReferenceEquals(System.Object,System.Object)
  • System.Object.ToString

Was this page helpful?