C# 클래스 Oglr.Core.Disk

Represents a disk. A facade over the Path and File API's.
상속: IDisk
파일 보기 프로젝트 열기: SteveDunn/oglr 1 사용 예제들

공개 메소드들

메소드 설명
Combine ( string firstPart, string secondPart ) : string
CopyFolder ( string fromDirectory, string toDirectory ) : void

Copies the folder.

CreateDirectoryIfDoesNotExist ( string directoryPath ) : void
DeleteFileOrDirectory ( string path ) : void

Deletes the file or directory.

DeleteFilesOrDirectories ( IEnumerable paths ) : void

Deletes the files or directories.

FileExists ( string localPath ) : bool
FilenamesInDirectory ( string pathToFolder, string searchPattern, SearchOption searchOption ) : IEnumerable
FolderExists ( string pathToFolder ) : bool
GetChildDirectoriesRecursively ( string directory ) : IEnumerable

Builds a list containing all the files under a specific directory

GetDirectoryNameFromPath ( string path ) : string
GetEntityType ( string path ) : DiskEntity

Gets the type of the entity, for instance, Folder, File, etc.

GetFilesInDirectoryRecursively ( string directory ) : IEnumerable

Builds a list containing all the files under a specific directory

GetTempPath ( ) : string
IsFile ( string path ) : bool

Determines whether the specified path is a file.

IsFolder ( string path ) : bool

Determines whether the specified path is a folder.

IsSubfolder ( string parentPath, string childPath ) : bool
MakeRelativePath ( string fromPath, string toPath ) : string

Creates a relative path from one file or folder to another.

ReadAllText ( string path ) : string

Reads a text file from disk

SetFileReadOnly ( string filePath, bool isReadOnly ) : void

Toggles the Read-Only attribute on a file

WriteTextToFile ( string path, string fileContents ) : void

Writes a text file to disk

비공개 메소드들

메소드 설명
areSameFolders ( DirectoryInfo left, DirectoryInfo right ) : bool
isDirectory ( string path ) : bool
isFileReadOnly ( string path ) : bool

메소드 상세

Combine() 공개 메소드

public Combine ( string firstPart, string secondPart ) : string
firstPart string
secondPart string
리턴 string

CopyFolder() 공개 메소드

Copies the folder.
public CopyFolder ( string fromDirectory, string toDirectory ) : void
fromDirectory string From directory.
toDirectory string To directory.
리턴 void

CreateDirectoryIfDoesNotExist() 공개 메소드

public CreateDirectoryIfDoesNotExist ( string directoryPath ) : void
directoryPath string
리턴 void

DeleteFileOrDirectory() 공개 메소드

Deletes the file or directory.
public DeleteFileOrDirectory ( string path ) : void
path string The path to the file or directory.
리턴 void

DeleteFilesOrDirectories() 공개 메소드

Deletes the files or directories.
public DeleteFilesOrDirectories ( IEnumerable paths ) : void
paths IEnumerable The paths.
리턴 void

FileExists() 공개 메소드

public FileExists ( string localPath ) : bool
localPath string
리턴 bool

FilenamesInDirectory() 공개 메소드

public FilenamesInDirectory ( string pathToFolder, string searchPattern, SearchOption searchOption ) : IEnumerable
pathToFolder string
searchPattern string
searchOption SearchOption
리턴 IEnumerable

FolderExists() 공개 메소드

public FolderExists ( string pathToFolder ) : bool
pathToFolder string
리턴 bool

GetChildDirectoriesRecursively() 공개 메소드

Builds a list containing all the files under a specific directory
public GetChildDirectoriesRecursively ( string directory ) : IEnumerable
directory string The parent directory.
리턴 IEnumerable

GetDirectoryNameFromPath() 공개 메소드

public GetDirectoryNameFromPath ( string path ) : string
path string
리턴 string

GetEntityType() 공개 메소드

Gets the type of the entity, for instance, Folder, File, etc.
public GetEntityType ( string path ) : DiskEntity
path string The path to the item on disk.
리턴 DiskEntity

GetFilesInDirectoryRecursively() 공개 메소드

Builds a list containing all the files under a specific directory
public GetFilesInDirectoryRecursively ( string directory ) : IEnumerable
directory string The parent directory.
리턴 IEnumerable

GetTempPath() 공개 메소드

public GetTempPath ( ) : string
리턴 string

IsFile() 공개 메소드

Determines whether the specified path is a file.
public IsFile ( string path ) : bool
path string The path to the disk entity.
리턴 bool

IsFolder() 공개 메소드

Determines whether the specified path is a folder.
public IsFolder ( string path ) : bool
path string The path with which to see if it's a folder.
리턴 bool

IsSubfolder() 공개 메소드

public IsSubfolder ( string parentPath, string childPath ) : bool
parentPath string
childPath string
리턴 bool

MakeRelativePath() 공개 메소드

Creates a relative path from one file or folder to another.
public MakeRelativePath ( string fromPath, string toPath ) : string
fromPath string Contains the directory that defines the start of the relative path.
toPath string Contains the path that defines the endpoint of the relative path.
리턴 string

ReadAllText() 공개 메소드

Reads a text file from disk
public ReadAllText ( string path ) : string
path string The path to the file to read.
리턴 string

SetFileReadOnly() 공개 메소드

Toggles the Read-Only attribute on a file
public SetFileReadOnly ( string filePath, bool isReadOnly ) : void
filePath string The path to the file.
isReadOnly bool Whether or not to set the read only flag.
리턴 void

WriteTextToFile() 공개 메소드

Writes a text file to disk
public WriteTextToFile ( string path, string fileContents ) : void
path string The path of the file to write to.
fileContents string The contents to write.
리턴 void