diff options
Diffstat (limited to 'sonar-scanner-protocol/src')
-rw-r--r-- | sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java index 2fb837b2558..d5e66955ab3 100644 --- a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java +++ b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java @@ -120,6 +120,19 @@ public class ScannerReportReader { return file.exists(); } + public CloseableIterator<ScannerReport.LineSgnificantCode> readComponentSignificantCode(int fileRef) { + File file = fileStructure.fileFor(FileStructure.Domain.SGNIFICANT_CODE, fileRef); + if (fileExists(file)) { + return Protobuf.readStream(file, ScannerReport.LineSgnificantCode.parser()); + } + return emptyCloseableIterator(); + } + + public boolean hasSignificantCode(int fileRef) { + File file = fileStructure.fileFor(FileStructure.Domain.SGNIFICANT_CODE, fileRef); + return fileExists(file); + } + public CloseableIterator<ScannerReport.SyntaxHighlightingRule> readComponentSyntaxHighlighting(int fileRef) { File file = fileStructure.fileFor(FileStructure.Domain.SYNTAX_HIGHLIGHTINGS, fileRef); if (fileExists(file)) { |