C# Класс Microsoft.CodeAnalysis.Sarif.Writers.ResultLogJsonWriter

An implementation of IResultLogWriter that writes the results as JSON to a TextWriter.
Наследование: IResultLogWriter, IDisposable
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
CloseResults ( ) : void
Dispose ( ) : void

Writes the log footer and closes the underlying JsonWriter.

Initialize ( string id, string correlationId ) : void

Initializes the SARIF log by emitting properties and other constructs sufficient to being populating a run with results.

OpenResults ( ) : void
ResultLogJsonWriter ( JsonWriter jsonWriter ) : System

Initializes a new instance of the ResultLogJsonWriter class.

WriteConfigurationNotifications ( IEnumerable notifications ) : void
WriteFiles ( FileData>.IDictionary fileDictionary ) : void

Write information about scanned files to the log. This information may appear after the results, as the full list of scanned files might not be known until all results have been generated.

WriteInvocation ( Invocation invocation ) : void
WriteLogicalLocations ( LogicalLocation>.IDictionary logicalLocationsDictionary ) : void

Write information about the logical locations where results were produced to the log. This information may appear after the results, as the full list of logical locations will not be known until all results have been generated.

WriteResult ( System.Result result ) : void

Writes a result to the log.

This function makes a copy of the data stored in result; if a client wishes to reuse the result instance to avoid allocations they can do so. (This function may invoke an internal copy of the result or serialize it in place to disk, etc.)

WriteResults ( IEnumerable results ) : void

Writes a set of results to the log.

This function makes a copy of the data stored in results; if a client wishes to reuse the result instance to avoid allocations they can do so. (This function may invoke an internal copy of the result or serialize it in place to disk, etc.)

WriteRules ( IRule>.IDictionary rules ) : void
WriteTool ( Tool tool ) : void

Writes a tool information entry to the log. This must be the first entry written into a log, and it may be written at most once.

WriteToolNotifications ( IEnumerable notifications ) : void

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

Метод Описание
EnsureInitialized ( ) : void
EnsureResultsArrayIsNotOpen ( ) : void
EnsureStateNotAlreadySet ( Conditions invalidConditions ) : void

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

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

public CloseResults ( ) : void
Результат void

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

Writes the log footer and closes the underlying JsonWriter.
public Dispose ( ) : void
Результат void

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

Initializes the SARIF log by emitting properties and other constructs sufficient to being populating a run with results.
public Initialize ( string id, string correlationId ) : void
id string A string that uniquely identifies a run.
correlationId string A global identifier for a run that permits correlation with a larger automation process.
Результат void

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

public OpenResults ( ) : void
Результат void

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

Initializes a new instance of the ResultLogJsonWriter class.
public ResultLogJsonWriter ( JsonWriter jsonWriter ) : System
jsonWriter Newtonsoft.Json.JsonWriter The JSON writer. This class does not take ownership of the JSON /// writer; the caller is responsible for destroying it.
Результат System

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

public WriteConfigurationNotifications ( IEnumerable notifications ) : void
notifications IEnumerable
Результат void

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

Write information about scanned files to the log. This information may appear after the results, as the full list of scanned files might not be known until all results have been generated.
public WriteFiles ( FileData>.IDictionary fileDictionary ) : void
fileDictionary FileData>.IDictionary /// A dictionary whose keys are the URIs of scanned files and whose values provide /// information about those files. ///
Результат void

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

public WriteInvocation ( Invocation invocation ) : void
invocation Invocation
Результат void

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

Write information about the logical locations where results were produced to the log. This information may appear after the results, as the full list of logical locations will not be known until all results have been generated.
public WriteLogicalLocations ( LogicalLocation>.IDictionary logicalLocationsDictionary ) : void
logicalLocationsDictionary LogicalLocation>.IDictionary
Результат void

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

Writes a result to the log.
This function makes a copy of the data stored in result; if a client wishes to reuse the result instance to avoid allocations they can do so. (This function may invoke an internal copy of the result or serialize it in place to disk, etc.)
/// A file IO error occured. Clients implementing /// should allow these exceptions to propagate. /// /// Thrown if the tool info is not yet written. ///
public WriteResult ( System.Result result ) : void
result System.Result /// The result to write. ///
Результат void

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

Writes a set of results to the log.
This function makes a copy of the data stored in results; if a client wishes to reuse the result instance to avoid allocations they can do so. (This function may invoke an internal copy of the result or serialize it in place to disk, etc.)
/// A file IO error occured. Clients implementing /// should allow these exceptions to propagate. /// /// Thrown if the tool info is not yet written. /// /// Thrown if is null. ///
public WriteResults ( IEnumerable results ) : void
results IEnumerable /// The results to write. ///
Результат void

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

public WriteRules ( IRule>.IDictionary rules ) : void
rules IRule>.IDictionary
Результат void

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

Writes a tool information entry to the log. This must be the first entry written into a log, and it may be written at most once.
A file IO error occured. Clients implementing /// should allow these exceptions to propagate. Thrown if the tool info block has already been /// written.
public WriteTool ( Tool tool ) : void
tool Tool
Результат void

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

public WriteToolNotifications ( IEnumerable notifications ) : void
notifications IEnumerable
Результат void