C# Класс withSIX.Core.Tools.FileTools

Наследование: IEnableLogging
Показать файл Открыть проект

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

Свойство Тип Описание
IsRunningOnMono bool

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

Метод Описание
CheckFile ( string path, bool checkExists = false, bool mayBeUnc = true ) : bool
ComparePathsEqualCase ( string source, string destination ) : bool
ComparePathsOsCaseSensitive ( IAbsolutePath path1, IAbsolutePath path2 ) : bool
ComparePathsOsCaseSensitive ( string path1, string path2 ) : bool
CreateBatFile ( IAbsoluteDirectoryPath path, string name, string content ) : Task
FilterPath ( FileSystemInfo info ) : string
FilterPath ( IPath info ) : string
FilterPath ( string pathName ) : string
FindParentWithName ( IAbsoluteDirectoryPath path, string key ) : IAbsoluteDirectoryPath
FindPathInParents ( string path, string key ) : string
GetDirectorySize ( IAbsoluteDirectoryPath p, string filter = null, string selector = "*.*", bool recurse = true ) : long
GetFileSize ( double size, Units unit = Units.B, string postFix = null ) : string
GetFileVersion ( string file ) : FileVersionInfo
GetFiles ( IAbsoluteDirectoryPath directory, string fileMask = "*.*", IEnumerable dirRootExclusions = null, IEnumerable fileRootExclusions = null ) : IEnumerable
GetVersion ( IAbsoluteFilePath exePath ) : System.Version
HandleDowncase ( string entry, IReadOnlyCollection excludes = null ) : void
HandleDowncaseFolder ( IAbsoluteDirectoryPath entry, IReadOnlyCollection excludes = null ) : void
IsDirectoryEmpty ( IAbsoluteDirectoryPath path ) : bool
IsPathRootedDirectlyIn ( IAbsoluteDirectoryPath path, IAbsoluteDirectoryPath root, bool mayBeEqual = false ) : bool
IsPathRootedIn ( IAbsoluteDirectoryPath path, IAbsoluteDirectoryPath root, bool mayBeEqual = false ) : bool
IsValidRootedPath ( string path, bool checkExists = false, bool mayBeUnc = false ) : bool
Lock ( string path, Func action ) : Task
MakeValidFileName ( string fileName, string ext ) : string
OpenCommandPrompt ( IAbsoluteDirectoryPath path ) : void
OpenFolderInExplorer ( IAbsoluteDirectoryPath path ) : void
OpenFolderInExplorer ( string path ) : void
OrderBySize ( IEnumerable ar, bool reverse = false ) : string[]
RemoveExtension ( string filePath, string toRemove = null ) : string
SelectInExplorer ( string path ) : void
SizePrediction ( string filePath ) : long

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

Метод Описание
CleanPath ( string path ) : string
GetFullCleanPath ( string path ) : string
GetIsRunningOnMono ( ) : bool
IsSameRoot ( IAbsoluteDirectoryPath sourcePath, IAbsoluteDirectoryPath destinationPath ) : bool
MakeValidBatFileName ( string fileName ) : string

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

CheckFile() публичный Метод

public CheckFile ( string path, bool checkExists = false, bool mayBeUnc = true ) : bool
path string
checkExists bool
mayBeUnc bool
Результат bool

ComparePathsEqualCase() публичный Метод

public ComparePathsEqualCase ( string source, string destination ) : bool
source string
destination string
Результат bool

ComparePathsOsCaseSensitive() публичный Метод

public ComparePathsOsCaseSensitive ( IAbsolutePath path1, IAbsolutePath path2 ) : bool
path1 IAbsolutePath
path2 IAbsolutePath
Результат bool

ComparePathsOsCaseSensitive() публичный Метод

public ComparePathsOsCaseSensitive ( string path1, string path2 ) : bool
path1 string
path2 string
Результат bool

CreateBatFile() публичный Метод

public CreateBatFile ( IAbsoluteDirectoryPath path, string name, string content ) : Task
path IAbsoluteDirectoryPath
name string
content string
Результат Task

FilterPath() публичный Метод

public FilterPath ( FileSystemInfo info ) : string
info System.IO.FileSystemInfo
Результат string

FilterPath() публичный Метод

public FilterPath ( IPath info ) : string
info IPath
Результат string

FilterPath() публичный Метод

public FilterPath ( string pathName ) : string
pathName string
Результат string

FindParentWithName() публичный Метод

public FindParentWithName ( IAbsoluteDirectoryPath path, string key ) : IAbsoluteDirectoryPath
path IAbsoluteDirectoryPath
key string
Результат IAbsoluteDirectoryPath

FindPathInParents() публичный Метод

public FindPathInParents ( string path, string key ) : string
path string
key string
Результат string

GetDirectorySize() публичный Метод

public GetDirectorySize ( IAbsoluteDirectoryPath p, string filter = null, string selector = "*.*", bool recurse = true ) : long
p IAbsoluteDirectoryPath
filter string
selector string
recurse bool
Результат long

GetFileSize() публичный Метод

public GetFileSize ( double size, Units unit = Units.B, string postFix = null ) : string
size double
unit Units
postFix string
Результат string

GetFileVersion() публичный Метод

public GetFileVersion ( string file ) : FileVersionInfo
file string
Результат System.Diagnostics.FileVersionInfo

GetFiles() публичный Метод

public GetFiles ( IAbsoluteDirectoryPath directory, string fileMask = "*.*", IEnumerable dirRootExclusions = null, IEnumerable fileRootExclusions = null ) : IEnumerable
directory IAbsoluteDirectoryPath
fileMask string
dirRootExclusions IEnumerable
fileRootExclusions IEnumerable
Результат IEnumerable

GetVersion() публичный Метод

public GetVersion ( IAbsoluteFilePath exePath ) : System.Version
exePath IAbsoluteFilePath
Результат System.Version

HandleDowncase() публичный Метод

public HandleDowncase ( string entry, IReadOnlyCollection excludes = null ) : void
entry string
excludes IReadOnlyCollection
Результат void

HandleDowncaseFolder() публичный Метод

public HandleDowncaseFolder ( IAbsoluteDirectoryPath entry, IReadOnlyCollection excludes = null ) : void
entry IAbsoluteDirectoryPath
excludes IReadOnlyCollection
Результат void

IsDirectoryEmpty() публичный Метод

public IsDirectoryEmpty ( IAbsoluteDirectoryPath path ) : bool
path IAbsoluteDirectoryPath
Результат bool

IsPathRootedDirectlyIn() публичный Метод

public IsPathRootedDirectlyIn ( IAbsoluteDirectoryPath path, IAbsoluteDirectoryPath root, bool mayBeEqual = false ) : bool
path IAbsoluteDirectoryPath
root IAbsoluteDirectoryPath
mayBeEqual bool
Результат bool

IsPathRootedIn() публичный Метод

public IsPathRootedIn ( IAbsoluteDirectoryPath path, IAbsoluteDirectoryPath root, bool mayBeEqual = false ) : bool
path IAbsoluteDirectoryPath
root IAbsoluteDirectoryPath
mayBeEqual bool
Результат bool

IsValidRootedPath() публичный Метод

public IsValidRootedPath ( string path, bool checkExists = false, bool mayBeUnc = false ) : bool
path string
checkExists bool
mayBeUnc bool
Результат bool

Lock() публичный Метод

public Lock ( string path, Func action ) : Task
path string
action Func
Результат Task

MakeValidFileName() публичный Метод

public MakeValidFileName ( string fileName, string ext ) : string
fileName string
ext string
Результат string

OpenCommandPrompt() публичный Метод

public OpenCommandPrompt ( IAbsoluteDirectoryPath path ) : void
path IAbsoluteDirectoryPath
Результат void

OpenFolderInExplorer() публичный Метод

public OpenFolderInExplorer ( IAbsoluteDirectoryPath path ) : void
path IAbsoluteDirectoryPath
Результат void

OpenFolderInExplorer() публичный Метод

public OpenFolderInExplorer ( string path ) : void
path string
Результат void

OrderBySize() публичный Метод

public OrderBySize ( IEnumerable ar, bool reverse = false ) : string[]
ar IEnumerable
reverse bool
Результат string[]

RemoveExtension() публичный Метод

public RemoveExtension ( string filePath, string toRemove = null ) : string
filePath string
toRemove string
Результат string

SelectInExplorer() публичный Метод

public SelectInExplorer ( string path ) : void
path string
Результат void

SizePrediction() публичный Метод

public SizePrediction ( string filePath ) : long
filePath string
Результат long

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

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

public static bool IsRunningOnMono
Результат bool