C# Класс fCraft.Paths

Contains fCraft path settings, and some filesystem-related utilities.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
WorkingPathDefault string

Открытые методы

Метод Описание
Compare ( [ p1, [ p2 ) : bool

Returns true if paths or filenames reference the same location (accounts for all the filesystem quirks).

Compare ( [ p1, [ p2, bool caseSensitive ) : bool

Returns true if paths or filenames reference the same location (accounts for all the filesystem quirks).

Contains ( [ parentPath, [ childPath ) : bool

Checks whether childPath is inside parentPath

Contains ( [ parentPath, [ childPath, bool caseSensitive ) : bool

Checks whether childPath is inside parentPath

Exists ( [ fileInfo, bool caseSensitive ) : bool

Checks whether the file exists in a specified way (case-sensitive or case-insensitive)

FileExists ( [ fileName, bool caseSensitive ) : bool

Checks whether the file exists in a specified way (case-sensitive or case-insensitive)

FindFiles ( [ fullFileName ) : System.IO.FileInfo[]

Find files that match the name in a case-insensitive way.

ForceRename ( [ originalFullFileName, [ newFileName ) : void

Allows making changes to filename capitalization on case-insensitive filesystems.

IsDefaultMapPath ( [ path ) : bool
IsProtectedFileName ( [ fileName ) : bool
IsValidPath ( string path ) : bool
MoveOrReplace ( [ source, [ destination ) : void
TestDirectory ( [ pathLabel, [ path, bool checkForWriteAccess ) : bool

Makes sure that the path format is valid, that it exists, that it is accessible and writeable.

TestFile ( [ fileLabel, [ filename, bool createIfDoesNotExist, FileAccess neededAccess ) : bool

Makes sure that the path format is valid, and optionally whether it is readable/writeable.

Приватные методы

Метод Описание
Paths ( ) : System

Описание методов

Compare() публичный статический Метод

Returns true if paths or filenames reference the same location (accounts for all the filesystem quirks).
public static Compare ( [ p1, [ p2 ) : bool
p1 [
p2 [
Результат bool

Compare() публичный статический Метод

Returns true if paths or filenames reference the same location (accounts for all the filesystem quirks).
public static Compare ( [ p1, [ p2, bool caseSensitive ) : bool
p1 [
p2 [
caseSensitive bool
Результат bool

Contains() публичный статический Метод

Checks whether childPath is inside parentPath
public static Contains ( [ parentPath, [ childPath ) : bool
parentPath [ Path that is supposed to contain childPath
childPath [ Path that is supposed to be contained within parentPath
Результат bool

Contains() публичный статический Метод

Checks whether childPath is inside parentPath
public static Contains ( [ parentPath, [ childPath, bool caseSensitive ) : bool
parentPath [ Path that is supposed to contain childPath
childPath [ Path that is supposed to be contained within parentPath
caseSensitive bool Whether check should be case-sensitive or case-insensitive.
Результат bool

Exists() публичный статический Метод

Checks whether the file exists in a specified way (case-sensitive or case-insensitive)
public static Exists ( [ fileInfo, bool caseSensitive ) : bool
fileInfo [ FileInfo object in question
caseSensitive bool Whether check should be case-sensitive or case-insensitive.
Результат bool

FileExists() публичный статический Метод

Checks whether the file exists in a specified way (case-sensitive or case-insensitive)
public static FileExists ( [ fileName, bool caseSensitive ) : bool
fileName [ filename in question
caseSensitive bool Whether check should be case-sensitive or case-insensitive.
Результат bool

FindFiles() публичный статический Метод

Find files that match the name in a case-insensitive way.
public static FindFiles ( [ fullFileName ) : System.IO.FileInfo[]
fullFileName [ Case-insensitive filename to look for.
Результат System.IO.FileInfo[]

ForceRename() публичный статический Метод

Allows making changes to filename capitalization on case-insensitive filesystems.
public static ForceRename ( [ originalFullFileName, [ newFileName ) : void
originalFullFileName [ Full path to the original filename
newFileName [ New file name (do not include the full path)
Результат void

IsDefaultMapPath() публичный статический Метод

public static IsDefaultMapPath ( [ path ) : bool
path [
Результат bool

IsProtectedFileName() публичный статический Метод

public static IsProtectedFileName ( [ fileName ) : bool
fileName [
Результат bool

IsValidPath() публичный статический Метод

public static IsValidPath ( string path ) : bool
path string
Результат bool

MoveOrReplace() публичный статический Метод

public static MoveOrReplace ( [ source, [ destination ) : void
source [
destination [
Результат void

TestDirectory() публичный статический Метод

Makes sure that the path format is valid, that it exists, that it is accessible and writeable.
public static TestDirectory ( [ pathLabel, [ path, bool checkForWriteAccess ) : bool
pathLabel [ Name of the path that's being tested (e.g. "map path"). Used for logging.
path [ Full or partial path.
checkForWriteAccess bool If set, tries to write to the given directory.
Результат bool

TestFile() публичный статический Метод

Makes sure that the path format is valid, and optionally whether it is readable/writeable.
public static TestFile ( [ fileLabel, [ filename, bool createIfDoesNotExist, FileAccess neededAccess ) : bool
fileLabel [ Name of the path that's being tested (e.g. "map path"). Used for logging.
filename [ Full or partial path of the file.
createIfDoesNotExist bool If target file is missing and this option is OFF, TestFile returns true. /// If target file is missing and this option is ON, TestFile tries to create /// a file and returns whether it succeeded.
neededAccess FileAccess If file is present, type of access to test.
Результат bool

Описание свойств

WorkingPathDefault публичное статическое свойство

public static string WorkingPathDefault
Результат string