Cppcheck
|
This class works as an example of how CppCheck can be used in external programs without very little knowledge of the internal parts of the program itself. More...
#include <cppcheckexecutor.h>
Public Member Functions | |
CppCheckExecutor ()=default | |
Constructor. More... | |
CppCheckExecutor (const CppCheckExecutor &)=delete | |
CppCheckExecutor & | operator= (const CppCheckExecutor &)=delete |
int | check (int argc, const char *const argv[]) |
Starts the checking. More... | |
Static Public Member Functions | |
static void | setExceptionOutput (FILE *exceptionOutput) |
static FILE * | getExceptionOutput () |
Protected Member Functions | |
int | check_wrapper (const Settings &settings) |
Wrapper around check_internal. More... | |
int | check_internal (const Settings &settings) const |
Starts the checking. More... | |
Static Protected Member Functions | |
static bool | reportSuppressions (const Settings &settings, const SuppressionList &suppressions, bool unusedFunctionCheckEnabled, const std::list< FileWithDetails > &files, const std::list< FileSettings > &fileSettings, ErrorLogger &errorLogger) |
Protected Attributes | |
std::list< FileWithDetails > | mFiles |
Filename associated with size of file. More... | |
std::list< FileSettings > | mFileSettings |
Static Private Member Functions | |
static int | executeCommand (std::string exe, std::vector< std::string > args, std::string redirect, std::string &output_) |
Execute a shell command and read the output from it. More... | |
Friends | |
class | TestSuppressions |
This class works as an example of how CppCheck can be used in external programs without very little knowledge of the internal parts of the program itself.
If you wish to use cppcheck e.g. as a part of IDE, just rewrite this class for your needs and possibly use other methods from CppCheck class instead the ones used here.
Definition at line 43 of file cppcheckexecutor.h.
|
default |
Constructor.
|
delete |
int CppCheckExecutor::check | ( | int | argc, |
const char *const | argv[] | ||
) |
Starts the checking.
Definition at line 185 of file cppcheckexecutor.cpp.
References check_wrapper(), executeCommand(), CmdLineParser::fillSettingsFromArgs(), CmdLineParser::getFiles(), CmdLineParser::getFileSettings(), Settings::loadSummaries(), mFiles, mFileSettings, Settings::setMisraRuleTexts(), Settings::supprs, and Settings::terminated().
Referenced by main().
|
protected |
Starts the checking.
settings | the settings |
Definition at line 250 of file cppcheckexecutor.cpp.
References Settings::buildDir, ProcessExecutor::check(), SingleExecutor::check(), ThreadExecutor::check(), Settings::checkConfiguration, Settings::checkersReportFilename, Settings::checks, Settings::cppcheckCfgProductName, emptyString, executeCommand(), Settings::executor, Settings::exitCode, ErrorMessage::getXMLFooter(), ErrorMessage::getXMLHeader(), information, SimpleEnableGroup< T >::isEnabled(), mFiles, mFileSettings, Settings::reportProgress, reportSuppressions(), Settings::safety, Settings::severity, unusedFunction, Settings::userDefines, Settings::useSingleJob(), AnalyzerInformation::writeFilesTxt(), and Settings::xml.
Referenced by check_wrapper().
|
protected |
Wrapper around check_internal.
settings | the settings |
Definition at line 209 of file cppcheckexecutor.cpp.
References check_internal().
Referenced by check().
|
staticprivate |
Execute a shell command and read the output from it.
Returns exitcode of the executed command,.
Returns true if command terminated successfully.
Definition at line 475 of file cppcheckexecutor.cpp.
Referenced by check(), and check_internal().
|
static |
|
delete |
|
staticprotected |
Definition at line 221 of file cppcheckexecutor.cpp.
References SuppressionList::getSuppressions(), SuppressionList::getUnmatchedGlobalSuppressions(), SuppressionList::getUnmatchedLocalSuppressions(), SuppressionList::reportUnmatchedSuppressions(), and Settings::useSingleJob().
Referenced by check_internal().
|
static |
exceptionOutput | Output file |
Referenced by CmdLineParser::parseFromArgs().
|
friend |
Definition at line 45 of file cppcheckexecutor.h.
|
protected |
Filename associated with size of file.
Definition at line 110 of file cppcheckexecutor.h.
Referenced by check(), and check_internal().
|
protected |
Definition at line 112 of file cppcheckexecutor.h.
Referenced by check(), and check_internal().