Fields (11) Methods (28)
Namespace: SchwabenCode.QuickIO

Syntax

public static class QuickIOPath

Summary

Performs operations for files or directories and path information.

Used by

Fields

DirectorySeparatorChar

Directory Separator Char

public  Char DirectorySeparatorChar

MaxRegularPathLength

Maximum allowed length of a regular path

public const Int32 MaxRegularPathLength

Constant Value

260

MaxSimpleDirectoryPathLength

Maximum allowed length of a regular folder path

public const Int32 MaxSimpleDirectoryPathLength

Constant Value

247

MaxUncPathLength

Maximum allowed length of an UNC Path

public const Int32 MaxUncPathLength

Constant Value

32767

RegularLocalPathPrefix

Regular local path prefix

public const String RegularLocalPathPrefix

RegularSharePathPrefix

Path prefix for shares

public const String RegularSharePathPrefix

Constant Value

\\

RegularSharePathPrefixLength

Length of Path prefix for shares

public readonly Int32 RegularSharePathPrefixLength

UncLocalPathPrefix

UNC prefix for regular paths

public const String UncLocalPathPrefix

Constant Value

\\?\

UncLocalPathPrefixLength

Length of UNC prefix for regular paths

public readonly Int32 UncLocalPathPrefixLength

UncSharePathPrefix

UNC prefix for shares

public const String UncSharePathPrefix

Constant Value

\\?\UNC\

UncSharePathPrefixLength

Length of UNC prefix for shares

public readonly Int32 UncSharePathPrefixLength

Methods

Combine(String[] pathElements)

Combines given path elements

public static String Combine(String[] pathElements)

Parameters

pathElements

String[]

Path elements to combine

Returns

Combined Path

Exists(String path)

Checks if path exists

public static Boolean Exists(String path)

Parameters

path

String

Path to check

Returns

True on exists

GetFullPath(String path)

A wrapper for GetFullPath

public static String GetFullPath(String path)

GetFullPathInfo(String path)

A wrapper for GetFullPath that returns QuickIOPathInfo

public static QuickIOPathInfo GetFullPathInfo(String path)

GetName(String fullName)

Gets name of file or directory

public static String GetName(String fullName)

Parameters

fullName

String

Path

Returns

Name of file or directory

Exceptions

InvalidPathException

Path is invalid

GetParentPath(String fullName)

Returns the parent directory path

public static String GetParentPath(String fullName)

Parameters

fullName

String

Path to get the parent from

Returns

Parent directory

GetRandomDirectoryName()

Returns GetRandomFileName without extension

public static String GetRandomDirectoryName()

Returns

GetRandomFileName without extension

GetRandomFileName()

Returns GetRandomFileName

public static String GetRandomFileName()

Returns

GetRandomFileName

GetRoot(String fullName)

Returns the root directory path

public static String GetRoot(String fullName)

Parameters

fullName

String

Path to get the parent from

Returns

Root directory

GetRootFromLocalPath(String path, QuickIOPathLocation location)

Returns root from path by given location type

public static String GetRootFromLocalPath(String path, QuickIOPathLocation location)

IsLocalRegularPath(String path)

Returns true if path is local regular path such as 'C:\folder\folder\file.txt'

public static Boolean IsLocalRegularPath(String path)

Parameters

path

String

Path

Returns

True if path is local regular path

IsLocalUncPath(String path)

Returns true if path is local UNC path such as '\?\C:\folder\folder\file.txt'

public static Boolean IsLocalUncPath(String path)

Parameters

path

String

Path

Returns

True if path is local UNC path

IsShareRegularPath(String path)

Returns true if path is share regular path such as '\server\share\folder\file.txt'

public static Boolean IsShareRegularPath(String path)

Parameters

path

String

Path

Returns

True if path is share regular path

IsShareUncPath(String path)

Returns true if path is share UNC path such as '\?\UNC\server\share\folder\file.txt'

public static Boolean IsShareUncPath(String path)

Parameters

path

String

Path

Returns

True if path is share UNC path

public static QuickIOParsePathResult ParsePath(String path, Boolean supportRelativePath)

ThrowIfPathContainsInvalidChars(String path)

Invalid Chars are: " < > | and all chars lower than ASCII value 32

public static void ThrowIfPathContainsInvalidChars(String path)

Parameters

path

String

Path to check

Exceptions

InvalidPathException

If invalid character found

Remarks

Ignores Unix File Systems

ToLocalRegularPath(String uncLocalPath)

Converts an unc path to a local regular path

public static String ToLocalRegularPath(String uncLocalPath)

Parameters

uncLocalPath

String

Unc Path

Returns

Local Regular Path

Example

\?\C:\temp\file.txt >> C:\temp\file.txt

ToLocalUncPath(String regularLocalPath)

Converts a regular local path to an unc path

public static String ToLocalUncPath(String regularLocalPath)

Parameters

regularLocalPath

String

Regular Path

Returns

Local Unc Path

Example

C:\temp\file.txt >> \?\C:\temp\file.txt

ToRegularPath(String anyFullname)

Converts unc path to regular path

public static String ToRegularPath(String anyFullname)

ToShareRegularPath(String uncSharePath)

Converts an unc path to a share regular path

public static String ToShareRegularPath(String uncSharePath)

Parameters

uncSharePath

String

Unc Path

Returns

QuickIOShareInfo Regular Path

Example

\?\UNC\server\share >> \server\share

ToShareUncPath(String regularSharePath)

Converts a regular share path to an unc path

public static String ToShareUncPath(String regularSharePath)

Parameters

regularSharePath

String

Regular Path

Returns

QuickIOShareInfo Unc Path

Example

\server\share\file.txt >> \?\UNC\server\share\file.txt

ToUncPath(String anyFullname)

Converts regular path to unc path

public static String ToUncPath(String anyFullname)
private static String TrimTrailingSepartor(String path)

TryParseLocalRegularPath(String path, QuickIOParsePathResult& parsePathResult)

Returns true if specified path is local regular path and returns result due to parsePathResult

public static Boolean TryParseLocalRegularPath(String path, QuickIOParsePathResult& parsePathResult)

Parameters

path

String

Local path to parse

parsePathResult

QuickIOParsePathResult&

QuickIOParsePathResult

Returns

True if parse succeeded and parsePathResult is filled

TryParseLocalUncPath(String path, QuickIOParsePathResult& parsePathResult)

Returns true if specified path is local UNC path and returns result due to parsePathResult

public static Boolean TryParseLocalUncPath(String path, QuickIOParsePathResult& parsePathResult)

Parameters

path

String

Local UNC path to parse

parsePathResult

QuickIOParsePathResult&

QuickIOParsePathResult

Returns

True if parse succeeded and parsePathResult is filled

public static Boolean TryParsePath(String path, QuickIOParsePathResult& parsePathResult, Boolean supportRelativePath)

Parameters

path

String

Path to parse

parsePathResult

QuickIOParsePathResult&

Result. See QuickIOParsePathResult

supportRelativePath

Boolean

true to support relative path

Returns

True on success. parsePathResult is set.

TryParseShareRegularPath(String path, QuickIOParsePathResult& parsePathResult)

Returns true if specified path is share regular path and returns result due to parsePathResult

public static Boolean TryParseShareRegularPath(String path, QuickIOParsePathResult& parsePathResult)

Parameters

path

String

QuickIOShareInfo regular path to parse

parsePathResult

QuickIOParsePathResult&

QuickIOParsePathResult

Returns

True if parse succeeded and parsePathResult is filled

TryParseShareUncPath(String path, QuickIOParsePathResult& parsePathResult)

Returns true if specified path is share UNC path and returns result due to parsePathResult

public static Boolean TryParseShareUncPath(String path, QuickIOParsePathResult& parsePathResult)

Parameters

path

String

QuickIOShareInfo UNC path to parse

parsePathResult

QuickIOParsePathResult&

QuickIOParsePathResult

Returns

True if parse succeeded and parsePathResult is filled