C# Class fCraft.Paths

Contains fCraft path settings, and some filesystem-related utilities.
Afficher le fichier Open project: GlennMR/800craft Class Usage Examples

Méthodes publiques

Свойство Type Description
WorkingPathDefault string

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
Paths ( ) : System

Method Details

Compare() public static méthode

Returns true if paths or filenames reference the same location (accounts for all the filesystem quirks).
public static Compare ( [ p1, [ p2 ) : bool
p1 [
p2 [
Résultat bool

Compare() public static méthode

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
Résultat bool

Contains() public static méthode

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
Résultat bool

Contains() public static méthode

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.
Résultat bool

Exists() public static méthode

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.
Résultat bool

FileExists() public static méthode

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.
Résultat bool

FindFiles() public static méthode

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.
Résultat System.IO.FileInfo[]

ForceRename() public static méthode

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)
Résultat void

IsDefaultMapPath() public static méthode

public static IsDefaultMapPath ( [ path ) : bool
path [
Résultat bool

IsProtectedFileName() public static méthode

public static IsProtectedFileName ( [ fileName ) : bool
fileName [
Résultat bool

IsValidPath() public static méthode

public static IsValidPath ( string path ) : bool
path string
Résultat bool

MoveOrReplace() public static méthode

public static MoveOrReplace ( [ source, [ destination ) : void
source [
destination [
Résultat void

TestDirectory() public static méthode

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.
Résultat bool

TestFile() public static méthode

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.
Résultat bool

Property Details

WorkingPathDefault public_oe static_oe property

public static string WorkingPathDefault
Résultat string