C# Class DroidExplorer.Core.IO.Path

显示文件 Open project: camalot/droidexplorer

Public Properties

Property Type Description
AltDirectorySeparatorChar char
DirectorySeparatorChar char
PathSeparator char

Public Methods

Method Description
ChangeExtension ( string path, string extension ) : string

Changes the extension of a path string.

Combine ( string path1, string path2 ) : string

Combines two path strings.

GetDirectoryName ( string path ) : string

Returns the directory information for the specified path string.

GetExtension ( string path ) : string

Returns the extension of the specified path string.

GetFileName ( string path ) : string

Returns the file name and extension of the specified path string.

GetFileNameWithoutExtension ( string path ) : string

Returns the file name of the specified path string without the extension.

GetInvalidFileNameChars ( ) : char[]

Gets an array containing the characters that are not allowed in file names.

GetInvalidPathChars ( ) : char[]

Gets an array containing the characters that are not allowed in path names.

GetPathRoot ( string path ) : string

Gets the root directory information of the specified path.

GetPathWithoutFile ( string path ) : string
HasExtension ( string path ) : bool

Determines whether a path includes a file name extension.

IsPathRooted ( string path ) : bool

Gets a value indicating whether the specified path string contains absolute or relative path information.

Private Methods

Method Description
CanPathCircumventSecurityNative ( string partOfPath ) : bool
CharArrayStartsWithOrdinal ( char array, int numChars, string compareTo, bool ignoreCase ) : bool
CheckInvalidPathChars ( string path ) : void
FixupPath ( string path ) : string
GetRootLength ( string path ) : int
InternalCombine ( string path1, string path2 ) : string
IsDirectorySeparator ( char c ) : bool

Method Details

ChangeExtension() public static method

Changes the extension of a path string.
The path contains one or more of the invalid characters defined in , or contains a wildcard character.
public static ChangeExtension ( string path, string extension ) : string
path string The path information to modify. The path cannot contain any of the characters defined in .
extension string The new extension (with a leading period). Specify null to remove an existing extension from path.
return string

Combine() public static method

Combines two path strings.
path1 or path2 is null. path1 or path2 contain one or more of the invalid characters defined in , or contains a wildcard character.
public static Combine ( string path1, string path2 ) : string
path1 string The first path.
path2 string The second path.
return string

GetDirectoryName() public static method

Returns the directory information for the specified path string.
The path parameter contains invalid characters, is empty, or contains only white spaces, or contains a wildcard character. The path parameter is longer than the system-defined maximum length.
public static GetDirectoryName ( string path ) : string
path string The path of a file or directory.
return string

GetExtension() public static method

Returns the extension of the specified path string.
path contains one or more of the invalid characters defined in , or contains a wildcard character.
public static GetExtension ( string path ) : string
path string The path string from which to get the extension.
return string

GetFileName() public static method

Returns the file name and extension of the specified path string.
path contains one or more of the invalid characters defined in , or contains a wildcard character.
public static GetFileName ( string path ) : string
path string The path string from which to obtain the file name and extension.
return string

GetFileNameWithoutExtension() public static method

Returns the file name of the specified path string without the extension.
path contains one or more of the invalid characters defined in , or contains a wildcard character.
public static GetFileNameWithoutExtension ( string path ) : string
path string The path of the file.
return string

GetInvalidFileNameChars() public static method

Gets an array containing the characters that are not allowed in file names.
public static GetInvalidFileNameChars ( ) : char[]
return char[]

GetInvalidPathChars() public static method

Gets an array containing the characters that are not allowed in path names.
public static GetInvalidPathChars ( ) : char[]
return char[]

GetPathRoot() public static method

Gets the root directory information of the specified path.
path contains one or more of the invalid characters defined in , or contains a wildcard character.-or- was passed to path.
public static GetPathRoot ( string path ) : string
path string The path from which to obtain root directory information.
return string

GetPathWithoutFile() public static method

public static GetPathWithoutFile ( string path ) : string
path string
return string

HasExtension() public static method

Determines whether a path includes a file name extension.
path contains one or more of the invalid characters defined in , or contains a wildcard character.
public static HasExtension ( string path ) : bool
path string The path to search for an extension.
return bool

IsPathRooted() public static method

Gets a value indicating whether the specified path string contains absolute or relative path information.
path contains one or more of the invalid characters defined in , or contains a wildcard character.
public static IsPathRooted ( string path ) : bool
path string The path to test.
return bool

Property Details

AltDirectorySeparatorChar public_oe static_oe property

public static char AltDirectorySeparatorChar
return char

DirectorySeparatorChar public_oe static_oe property

public static char DirectorySeparatorChar
return char

PathSeparator public_oe static_oe property

public static char PathSeparator
return char