com.thalesgroup.hudson.plugins.cppcheck
Class CppcheckSource

java.lang.Object
  extended by com.thalesgroup.hudson.plugins.cppcheck.CppcheckSource
All Implemented Interfaces:
java.io.Serializable

public class CppcheckSource
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
protected static int SOURCE_GENERATOR_OFFSET
          Offset of the source code generator.
 
Constructor Summary
CppcheckSource(hudson.model.AbstractBuild<?,?> owner, CppcheckFile cppcheckFile)
          Creates a new instance of this source code object.
 
Method Summary
 CppcheckFile getCppcheckFile()
           
 java.lang.String getSourceCode()
          Returns the line that should be highlighted.
 java.lang.String highlightSource(java.io.InputStream file)
          Highlights the specified source and returns the result as an HTML string.
 void splitSourceFile(java.lang.String sourceFile)
          Splits the source code into three blocks: the line to highlight and the source code before and after this line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCE_GENERATOR_OFFSET

protected static final int SOURCE_GENERATOR_OFFSET
Offset of the source code generator. After this line the actual source file lines start.

See Also:
Constant Field Values
Constructor Detail

CppcheckSource

public CppcheckSource(hudson.model.AbstractBuild<?,?> owner,
                      CppcheckFile cppcheckFile)
Creates a new instance of this source code object.

Parameters:
owner - the current build as owner of this object
annotation - the warning to display in the source file
defaultEncoding - the default encoding to be used when reading and parsing files
Method Detail

splitSourceFile

public final void splitSourceFile(java.lang.String sourceFile)
Splits the source code into three blocks: the line to highlight and the source code before and after this line.

Parameters:
sourceFile - the source code of the whole file as rendered HTML string

highlightSource

public final java.lang.String highlightSource(java.io.InputStream file)
                                       throws java.io.IOException
Highlights the specified source and returns the result as an HTML string.

Parameters:
file - the source file to highlight
Returns:
the source as an HTML string
Throws:
java.io.IOException

getSourceCode

public java.lang.String getSourceCode()
Returns the line that should be highlighted.

Returns:
the line to highlight

getCppcheckFile

public CppcheckFile getCppcheckFile()


Copyright © 2009. All Rights Reserved.