C# Class Microsoft.CodeAnalysis.Sarif.Driver.FileSystem

A wrapper class for accessing the file system.
Clients should use this class rather directly using the .NET file system classes, so they can mock the IFileSystem interface in unit tests.
Inheritance: IFileSystem
Mostra file Open project: Microsoft/sarif-sdk

Public Methods

Method Description
FileExists ( string path ) : bool

Determines whether the specified file exists.

GetFullPath ( string path ) : string

Returns the absolute path for the specified path string.

ReadAllLines ( string path ) : string[]

Opens a text file, reads all lines of the file, and then closes the file.

ReadAllText ( string path ) : string

Opens a text file, reads all text in the file as a single string, and then closes the file.

Method Details

FileExists() public method

Determines whether the specified file exists.
public FileExists ( string path ) : bool
path string /// The file to check. ///
return bool

GetFullPath() public method

Returns the absolute path for the specified path string.
public GetFullPath ( string path ) : string
path string /// The file or directory for which to obtain absolute path information. ///
return string

ReadAllLines() public method

Opens a text file, reads all lines of the file, and then closes the file.
public ReadAllLines ( string path ) : string[]
path string /// The file to open for reading. ///
return string[]

ReadAllText() public method

Opens a text file, reads all text in the file as a single string, and then closes the file.
public ReadAllText ( string path ) : string
path string /// The file to open for reading. ///
return string