Cppcheck
|
A class that reads and writes project files. More...
#include <projectfile.h>
Classes | |
class | SafeChecks |
Do not only check how interface is used. More... | |
Public Types | |
enum class | CheckLevel { normal , exhaustive } |
Public Member Functions | |
ProjectFile (QObject *parent=nullptr) | |
ProjectFile (QString filename, QObject *parent=nullptr) | |
~ProjectFile () override | |
void | setActiveProject () |
bool | read (const QString &filename=QString()) |
Read the project file. More... | |
const QString & | getRootPath () const |
Get project root path. More... | |
const QString & | getBuildDir () const |
const QString & | getImportProject () const |
bool | getAnalyzeAllVsConfigs () const |
bool | getCheckHeaders () const |
void | setCheckHeaders (bool b) |
bool | getCheckUnusedTemplates () const |
void | setCheckUnusedTemplates (bool b) |
QStringList | getIncludeDirs () const |
Get list of include directories. More... | |
const QStringList & | getDefines () const |
Get list of defines. More... | |
const QStringList & | getUndefines () const |
Get list of undefines. More... | |
QStringList | getCheckPaths () const |
Get list of paths to check. More... | |
QStringList | getExcludedPaths () const |
Get list of paths to exclude from the check. More... | |
const QStringList & | getVsConfigurations () const |
Get list of paths to exclude from the check. More... | |
const QStringList & | getLibraries () const |
Get list libraries. More... | |
const QString & | getPlatform () const |
Get platform. More... | |
const QString & | getProjectName () const |
void | setProjectName (QString projectName) |
const QList< SuppressionList::Suppression > & | getSuppressions () const |
Get "raw" suppressions. More... | |
QList< SuppressionList::Suppression > | getCheckingSuppressions () const |
Get "checking" suppressions. More... | |
const QStringList & | getAddons () const |
Get list addons. More... | |
QStringList | getAddonsAndTools () const |
Get list of addons and tools. More... | |
bool | getClangAnalyzer () const |
void | setClangAnalyzer (bool c) |
bool | getClangTidy () const |
void | setClangTidy (bool c) |
const QStringList & | getTags () const |
int | getMaxCtuDepth () const |
void | setMaxCtuDepth (int maxCtuDepth) |
int | getMaxTemplateRecursion () const |
void | setMaxTemplateRecursion (int maxTemplateRecursion) |
const QString & | getFilename () const |
Get filename for the project file. More... | |
void | setRootPath (const QString &rootpath) |
Set project root path. More... | |
void | setBuildDir (const QString &buildDir) |
void | setImportProject (const QString &importProject) |
void | setAnalyzeAllVsConfigs (bool b) |
void | setIncludes (const QStringList &includes) |
Set list of includes. More... | |
void | setDefines (const QStringList &defines) |
Set list of defines. More... | |
void | setUndefines (const QStringList &undefines) |
Set list of undefines. More... | |
void | setCheckPaths (const QStringList &paths) |
Set list of paths to check. More... | |
void | setExcludedPaths (const QStringList &paths) |
Set list of paths to exclude from the check. More... | |
void | setLibraries (const QStringList &libraries) |
Set list of libraries. More... | |
void | setPlatform (const QString &platform) |
Set platform. More... | |
void | setSuppressions (const QList< SuppressionList::Suppression > &suppressions) |
Set list of suppressions. More... | |
void | addSuppression (const SuppressionList::Suppression &suppression) |
Add suppression. More... | |
void | setAddons (const QStringList &addons) |
Set list of addons. More... | |
void | setVSConfigurations (const QStringList &vsConfigs) |
Set list of Visual Studio configurations to be checked. More... | |
void | setCheckLevel (CheckLevel checkLevel) |
CheckLevel: normal/exhaustive. More... | |
bool | isCheckLevelExhaustive () const |
void | setTags (const QStringList &tags) |
Set tags. More... | |
void | setWarningTags (std::size_t hash, const QString &tags) |
Set tags for a warning. More... | |
QString | getWarningTags (std::size_t hash) const |
Get tags for a warning. More... | |
void | setBughunting (bool bughunting) |
Bughunting (Cppcheck Premium) More... | |
bool | getBughunting () const |
const QStringList & | getCodingStandards () const |
Get list of coding standards (checked by Cppcheck Premium). More... | |
void | setCodingStandards (QStringList codingStandards) |
Set list of coding standards (checked by Cppcheck Premium). More... | |
void | setCertIntPrecision (int p) |
Cert C: int precision. More... | |
int | getCertIntPrecision () const |
bool | write (const QString &filename=QString()) |
Write project file (to disk). More... | |
void | setFilename (const QString &filename) |
Set filename for the project file. More... | |
const QStringList & | getCheckUnknownFunctionReturn () const |
Check unknown function return values. More... | |
Static Public Member Functions | |
static ProjectFile * | getActiveProject () |
static QString | getAddonFilePath (QString filesDir, const QString &addon) |
Get path to addon python script. More... | |
Public Attributes | |
SafeChecks | safeChecks |
bool | clangParser |
Use Clang parser. More... | |
Protected Member Functions | |
void | readRootPath (const QXmlStreamReader &reader) |
Read optional root path from XML. More... | |
void | readBuildDir (QXmlStreamReader &reader) |
void | readImportProject (QXmlStreamReader &reader) |
Read importproject from XML. More... | |
void | readIncludeDirs (QXmlStreamReader &reader) |
Read list of include directories from XML. More... | |
void | readDefines (QXmlStreamReader &reader) |
Read list of defines from XML. More... | |
void | readCheckPaths (QXmlStreamReader &reader) |
Read list paths to check. More... | |
void | readExcludes (QXmlStreamReader &reader) |
Read lists of excluded paths. More... | |
void | readVsConfigurations (QXmlStreamReader &reader) |
Read lists of Visual Studio configurations. More... | |
void | readPlatform (QXmlStreamReader &reader) |
Read platform text. More... | |
void | readSuppressions (QXmlStreamReader &reader) |
Read suppressions. More... | |
void | readTagWarnings (QXmlStreamReader &reader, const QString &tag) |
Read tag warnings, what warnings are tagged with a specific tag. More... | |
Static Protected Member Functions | |
static bool | readBool (QXmlStreamReader &reader) |
static int | readInt (QXmlStreamReader &reader, int defaultValue) |
static QString | readString (QXmlStreamReader &reader) |
static void | readStringList (QStringList &stringlist, QXmlStreamReader &reader, const char elementname[]) |
Read string list. More... | |
static void | writeStringList (QXmlStreamWriter &xmlWriter, const QStringList &stringlist, const char startelementname[], const char stringelementname[]) |
Write string list. More... | |
Private Member Functions | |
void | clear () |
Static Private Member Functions | |
static QStringList | fromNativeSeparators (const QStringList &paths) |
Convert paths. More... | |
Private Attributes | |
QString | mFilename |
Filename (+path) of the project file. More... | |
QString | mRootPath |
Root path (optional) for the project. More... | |
QString | mBuildDir |
Cppcheck build dir. More... | |
QString | mImportProject |
Visual studio project/solution , compile database. More... | |
bool | mAnalyzeAllVsConfigs |
Should all visual studio configurations be analyzed? If this is false then only the Debug configuration for the set platform is analyzed. More... | |
QStringList | mVsConfigurations |
Check only a selected VS configuration. More... | |
bool | mCheckHeaders |
Check code in headers. More... | |
bool | mCheckUnusedTemplates |
Check code in unused templates. More... | |
QStringList | mIncludeDirs |
List of include directories used to search include files. More... | |
QStringList | mDefines |
List of defines. More... | |
QStringList | mUndefines |
List of undefines. More... | |
QStringList | mPaths |
List of paths to check. More... | |
QStringList | mExcludedPaths |
Paths excluded from the check. More... | |
QStringList | mLibraries |
List of libraries. More... | |
QString | mPlatform |
Platform. More... | |
QList< SuppressionList::Suppression > | mSuppressions |
List of suppressions. More... | |
QStringList | mAddons |
List of addons. More... | |
bool | mBughunting = false |
CheckLevel | mCheckLevel = CheckLevel::normal |
Should Cppcheck run normal or exhaustive analysis? More... | |
QStringList | mCodingStandards |
List of coding standards, checked by Cppcheck Premium. More... | |
QString | mProjectName |
Project name, used when generating compliance report. More... | |
int | mCertIntPrecision |
Cppcheck Premium: This value is passed to the Cert C checker if that is enabled. More... | |
bool | mClangAnalyzer |
Execute clang analyzer? More... | |
bool | mClangTidy |
Execute clang-tidy? More... | |
QStringList | mTags |
Tags. More... | |
std::map< std::size_t, QString > | mWarningTags |
Warning tags. More... | |
int | mMaxCtuDepth |
Max CTU depth. More... | |
int | mMaxTemplateRecursion |
Max template instantiation recursion. More... | |
QStringList | mCheckUnknownFunctionReturn |
Static Private Attributes | |
static ProjectFile * | mActiveProject |
A class that reads and writes project files.
The project files contain project-specific settings for checking. For example a list of include paths.
Definition at line 46 of file projectfile.h.
|
strong |
Enumerator | |
---|---|
normal | |
exhaustive |
Definition at line 56 of file projectfile.h.
|
explicit |
Definition at line 44 of file projectfile.cpp.
References clear().
|
explicit |
Definition at line 50 of file projectfile.cpp.
|
inlineoverride |
Definition at line 52 of file projectfile.h.
References mActiveProject.
void ProjectFile::addSuppression | ( | const SuppressionList::Suppression & | suppression | ) |
Add suppression.
Definition at line 780 of file projectfile.cpp.
References mSuppressions.
Referenced by ResultsTree::suppressHash().
|
private |
Definition at line 58 of file projectfile.cpp.
References clangParser, Settings::SafeChecks::clear(), mAddons, mAnalyzeAllVsConfigs, Settings::maxCtuDepth, Settings::maxTemplateRecursion, mBughunting, mBuildDir, mCertIntPrecision, mCheckHeaders, mCheckLevel, mCheckUnknownFunctionReturn, mCheckUnusedTemplates, mClangAnalyzer, mClangTidy, mCodingStandards, mDefines, mExcludedPaths, mImportProject, mIncludeDirs, mLibraries, mMaxCtuDepth, mMaxTemplateRecursion, mPaths, mPlatform, mProjectName, mRootPath, mSuppressions, mTags, mUndefines, mVsConfigurations, mWarningTags, normal, and safeChecks.
Referenced by ProjectFile(), and read().
|
staticprivate |
Convert paths.
Definition at line 1050 of file projectfile.cpp.
Referenced by getCheckPaths(), getExcludedPaths(), and getIncludeDirs().
|
inlinestatic |
Definition at line 61 of file projectfile.h.
References mActiveProject.
Referenced by ResultsTree::addErrorItem(), ResultsTree::contextMenuEvent(), ResultsTree::suppressHash(), and ResultsTree::tagSelectedItems().
|
static |
Get path to addon python script.
filesDir | Data files folder set by –data-dir |
addon | addon i.e. "misra" to lookup |
Definition at line 1132 of file projectfile.cpp.
Referenced by MainWindow::loadAddon(), and updateAddonCheckBox().
|
inline |
Get list addons.
Definition at line 200 of file projectfile.h.
References mAddons.
Referenced by MainWindow::analyzeProject(), ComplianceReportDialog::ComplianceReportDialog(), MainWindow::enableCheckButtons(), MainWindow::getCppcheckSettings(), and updateAddonCheckBox().
QStringList ProjectFile::getAddonsAndTools | ( | ) | const |
Get list of addons and tools.
Definition at line 1058 of file projectfile.cpp.
References CLANG_ANALYZER, CLANG_TIDY, mAddons, mClangAnalyzer, and mClangTidy.
Referenced by MainWindow::analyzeProject(), MainWindow::doAnalyzeFiles(), and MainWindow::doAnalyzeProject().
|
inline |
Definition at line 90 of file projectfile.h.
References mAnalyzeAllVsConfigs.
Referenced by MainWindow::doAnalyzeProject(), and ProjectFileDialog::loadFromProjectFile().
|
inline |
Definition at line 365 of file projectfile.h.
References mBughunting.
Referenced by MainWindow::getCppcheckSettings(), and ProjectFileDialog::loadFromProjectFile().
|
inline |
Definition at line 82 of file projectfile.h.
References mBuildDir.
Referenced by MainWindow::analysisDone(), MainWindow::analyzeProject(), MainWindow::clearResults(), MainWindow::getCppcheckSettings(), MainWindow::getLastResults(), ProjectFileDialog::loadFromProjectFile(), and StatsDialog::setProject().
|
inline |
Definition at line 386 of file projectfile.h.
References mCertIntPrecision.
Referenced by MainWindow::getCppcheckSettings(), and ProjectFileDialog::loadFromProjectFile().
|
inline |
Definition at line 94 of file projectfile.h.
References mCheckHeaders.
Referenced by MainWindow::getCppcheckSettings(), and ProjectFileDialog::loadFromProjectFile().
QList< SuppressionList::Suppression > ProjectFile::getCheckingSuppressions | ( | ) | const |
Get "checking" suppressions.
Relative paths are converted to absolute paths.
Definition at line 760 of file projectfile.cpp.
References mFilename, and mSuppressions.
Referenced by MainWindow::doAnalyzeFiles(), and MainWindow::getCppcheckSettings().
|
inline |
Get list of paths to check.
Definition at line 138 of file projectfile.h.
References fromNativeSeparators(), and mPaths.
Referenced by MainWindow::analyzeProject(), ProjectFileDialog::loadFromProjectFile(), ComplianceReportDialog::save(), and StatsDialog::setProject().
|
inline |
Check unknown function return values.
Definition at line 417 of file projectfile.h.
References mCheckUnknownFunctionReturn.
Referenced by MainWindow::getCppcheckSettings().
|
inline |
Definition at line 102 of file projectfile.h.
References mCheckUnusedTemplates.
Referenced by MainWindow::getCppcheckSettings(), and ProjectFileDialog::loadFromProjectFile().
|
inline |
Definition at line 217 of file projectfile.h.
Referenced by ProjectFileDialog::loadFromProjectFile(), and StatsDialog::setProject().
|
inline |
Definition at line 225 of file projectfile.h.
References mClangTidy.
Referenced by ProjectFileDialog::loadFromProjectFile(), and StatsDialog::setProject().
|
inline |
Get list of coding standards (checked by Cppcheck Premium).
Definition at line 370 of file projectfile.h.
References mCodingStandards.
Referenced by ComplianceReportDialog::ComplianceReportDialog(), MainWindow::enableCheckButtons(), MainWindow::getCppcheckSettings(), and ProjectFileDialog::loadFromProjectFile().
|
inline |
Get list of defines.
Definition at line 122 of file projectfile.h.
References mDefines.
Referenced by MainWindow::getCppcheckSettings(), ProjectFileDialog::loadFromProjectFile(), and StatsDialog::setProject().
|
inline |
Get list of paths to exclude from the check.
Definition at line 146 of file projectfile.h.
References fromNativeSeparators(), and mExcludedPaths.
Referenced by MainWindow::doAnalyzeFiles(), MainWindow::doAnalyzeProject(), ProjectFileDialog::loadFromProjectFile(), MainWindow::reAnalyzeSelected(), and ComplianceReportDialog::save().
|
inline |
Get filename for the project file.
Definition at line 257 of file projectfile.h.
References mFilename.
Referenced by ProjectFileDialog::addExcludeFile(), MainWindow::analysisDone(), MainWindow::analyzeProject(), ProjectFileDialog::browseImportProject(), MainWindow::clearResults(), MainWindow::doAnalyzeFiles(), MainWindow::doAnalyzeProject(), MainWindow::getCppcheckSettings(), ProjectFileDialog::getExistingDirectory(), MainWindow::getLastResults(), MainWindow::loadLibrary(), MainWindow::MainWindow(), ProjectFileDialog::ProjectFileDialog(), MainWindow::reAnalyze(), ComplianceReportDialog::save(), MainWindow::saveSettings(), MainWindow::setLanguage(), and StatsDialog::setProject().
|
inline |
Definition at line 86 of file projectfile.h.
References mImportProject.
Referenced by MainWindow::analyzeProject(), MainWindow::getCppcheckSettings(), ProjectFileDialog::loadFromProjectFile(), and ComplianceReportDialog::save().
|
inline |
Get list of include directories.
Definition at line 114 of file projectfile.h.
References fromNativeSeparators(), and mIncludeDirs.
Referenced by MainWindow::getCppcheckSettings(), ProjectFileDialog::loadFromProjectFile(), and StatsDialog::setProject().
|
inline |
Get list libraries.
Definition at line 162 of file projectfile.h.
References mLibraries.
Referenced by MainWindow::getCppcheckSettings(), and ProjectFileDialog::loadFromProjectFile().
|
inline |
Definition at line 237 of file projectfile.h.
References mMaxCtuDepth.
Referenced by MainWindow::getCppcheckSettings(), and ProjectFileDialog::loadFromProjectFile().
|
inline |
Definition at line 245 of file projectfile.h.
References mMaxTemplateRecursion.
Referenced by MainWindow::getCppcheckSettings(), and ProjectFileDialog::loadFromProjectFile().
|
inline |
Get platform.
Definition at line 170 of file projectfile.h.
References mPlatform.
Referenced by MainWindow::getCppcheckSettings(), and ProjectFileDialog::loadFromProjectFile().
|
inline |
Definition at line 174 of file projectfile.h.
References mProjectName.
Referenced by ComplianceReportDialog::ComplianceReportDialog(), and ComplianceReportDialog::save().
|
inline |
Get project root path.
Definition at line 78 of file projectfile.h.
References mRootPath.
Referenced by MainWindow::analyzeProject(), ProjectFileDialog::loadFromProjectFile(), and StatsDialog::setProject().
|
inline |
Get "raw" suppressions.
Definition at line 186 of file projectfile.h.
References mSuppressions.
Referenced by MainWindow::doAnalyzeProject(), ProjectFileDialog::loadFromProjectFile(), ComplianceReportDialog::save(), and MainWindow::suppressIds().
|
inline |
Definition at line 233 of file projectfile.h.
References mTags.
Referenced by ResultsTree::contextMenuEvent(), and ProjectFileDialog::loadFromProjectFile().
|
inline |
Get list of undefines.
Definition at line 130 of file projectfile.h.
References mUndefines.
Referenced by MainWindow::getCppcheckSettings(), ProjectFileDialog::loadFromProjectFile(), and StatsDialog::setProject().
|
inline |
Get list of paths to exclude from the check.
Definition at line 154 of file projectfile.h.
References mVsConfigurations.
Referenced by MainWindow::doAnalyzeProject(), and ProjectFileDialog::loadFromProjectFile().
QString ProjectFile::getWarningTags | ( | std::size_t | hash | ) | const |
bool ProjectFile::isCheckLevelExhaustive | ( | ) | const |
Definition at line 800 of file projectfile.cpp.
References exhaustive, and mCheckLevel.
Referenced by MainWindow::getCppcheckSettings(), and ProjectFileDialog::loadFromProjectFile().
bool ProjectFile::read | ( | const QString & | filename = QString() | ) |
Read the project file.
filename | Filename (can be also given to constructor). |
Definition at line 94 of file projectfile.cpp.
References CppcheckXml::AddonElementName, CppcheckXml::AddonsElementName, CppcheckXml::AnalyzeAllVsConfigsElementName, CppcheckXml::BughuntingElementName, CppcheckXml::BuildDirElementName, CppcheckXml::CertIntPrecisionElementName, CppcheckXml::CheckHeadersElementName, CppcheckXml::CheckLevelExhaustiveElementName, CppcheckXml::CheckUnknownFunctionReturn, CppcheckXml::CheckUnusedTemplatesElementName, CLANG_ANALYZER, CLANG_TIDY, clangParser, clear(), CppcheckXml::CodingStandardElementName, CppcheckXml::CodingStandardsElementName, CppcheckXml::DefinesElementName, CppcheckXml::ExcludeElementName, exhaustive, CppcheckXml::IgnoreElementName, CppcheckXml::ImportProjectElementName, CppcheckXml::IncludeDirElementName, CppcheckXml::LibrariesElementName, CppcheckXml::LibraryElementName, ProjectFile::SafeChecks::loadFromXml(), mAddons, mAnalyzeAllVsConfigs, CppcheckXml::MaxCtuDepthElementName, CppcheckXml::MaxTemplateRecursionElementName, mBughunting, mCertIntPrecision, mCheckHeaders, mCheckLevel, mCheckUnknownFunctionReturn, mCheckUnusedTemplates, mClangAnalyzer, mClangTidy, mCodingStandards, mFilename, mLibraries, mMaxCtuDepth, mMaxTemplateRecursion, mProjectName, mTags, mUndefines, CppcheckXml::Name, CppcheckXml::Parser, CppcheckXml::PathsElementName, CppcheckXml::PlatformElementName, CppcheckXml::ProjectElementName, CppcheckXml::ProjectNameElementName, readBool(), readBuildDir(), readCheckPaths(), readDefines(), readExcludes(), readImportProject(), readIncludeDirs(), readInt(), readPlatform(), readRootPath(), readString(), readStringList(), readSuppressions(), readTagWarnings(), readVsConfigurations(), CppcheckXml::RootPathName, safeChecks, CppcheckXml::SuppressionsElementName, CppcheckXml::TagAttributeName, CppcheckXml::TagElementName, CppcheckXml::TagsElementName, CppcheckXml::TagWarningsElementName, CppcheckXml::ToolElementName, CppcheckXml::ToolsElementName, toString(), CppcheckXml::UndefineName, CppcheckXml::UndefinesElementName, CppcheckXml::VSConfigurationElementName, and Settings::SafeChecks::XmlRootName.
Referenced by MainWindow::loadSettings(), and ProjectFile().
|
staticprotected |
|
protected |
Definition at line 260 of file projectfile.cpp.
References FALLTHROUGH, and mBuildDir.
Referenced by read().
|
protected |
Read list paths to check.
reader | XML stream reader. |
Definition at line 463 of file projectfile.cpp.
References mPaths, CppcheckXml::PathName, CppcheckXml::PathNameAttrib, and CppcheckXml::PathsElementName.
Referenced by read().
|
protected |
Read list of defines from XML.
reader | XML stream reader. |
Definition at line 427 of file projectfile.cpp.
References CppcheckXml::DefineName, CppcheckXml::DefineNameAttrib, CppcheckXml::DefinesElementName, and mDefines.
Referenced by read().
|
protected |
Read lists of excluded paths.
reader | XML stream reader. |
Definition at line 500 of file projectfile.cpp.
References CppcheckXml::ExcludeElementName, CppcheckXml::ExcludePathName, CppcheckXml::ExcludePathNameAttrib, CppcheckXml::IgnoreElementName, CppcheckXml::IgnorePathName, CppcheckXml::IgnorePathNameAttrib, and mExcludedPaths.
Referenced by read().
|
protected |
Read importproject from XML.
reader | XML stream reader. |
Definition at line 286 of file projectfile.cpp.
References FALLTHROUGH, and mImportProject.
Referenced by read().
|
protected |
Read list of include directories from XML.
reader | XML stream reader. |
Definition at line 390 of file projectfile.cpp.
References CppcheckXml::DirElementName, CppcheckXml::DirNameAttrib, CppcheckXml::IncludeDirElementName, and mIncludeDirs.
Referenced by read().
|
staticprotected |
|
protected |
Read platform text.
reader | XML stream reader. |
Definition at line 582 of file projectfile.cpp.
References FALLTHROUGH, and mPlatform.
Referenced by read().
|
protected |
Read optional root path from XML.
reader | XML stream reader. |
Definition at line 252 of file projectfile.cpp.
References mRootPath, and CppcheckXml::RootPathNameAttrib.
Referenced by read().
|
staticprotected |
|
staticprotected |
Read string list.
stringlist | destination string list |
reader | XML stream reader |
elementname | elementname for each string |
Definition at line 688 of file projectfile.cpp.
Referenced by read().
|
protected |
Read suppressions.
reader | XML stream reader. |
Definition at line 608 of file projectfile.cpp.
References SuppressionList::Suppression::errorId, SuppressionList::Suppression::fileName, SuppressionList::Suppression::hash, SuppressionList::Suppression::lineNumber, mSuppressions, CppcheckXml::SuppressionElementName, and SuppressionList::Suppression::symbolName.
Referenced by read().
|
protected |
Read tag warnings, what warnings are tagged with a specific tag.
reader | XML stream reader. |
Definition at line 654 of file projectfile.cpp.
References CppcheckXml::HashAttributeName, mWarningTags, and CppcheckXml::WarningElementName.
Referenced by read().
|
protected |
Read lists of Visual Studio configurations.
reader | XML stream reader. |
Definition at line 545 of file projectfile.cpp.
References mVsConfigurations, and CppcheckXml::VSConfigurationName.
Referenced by read().
|
inline |
Definition at line 64 of file projectfile.h.
References mActiveProject.
Referenced by MainWindow::loadProjectFile(), MainWindow::loadSettings(), and MainWindow::newProjectFile().
void ProjectFile::setAddons | ( | const QStringList & | addons | ) |
Set list of addons.
addons | List of addons. |
Definition at line 785 of file projectfile.cpp.
References mAddons.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Definition at line 277 of file projectfile.h.
References mAnalyzeAllVsConfigs.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Bughunting (Cppcheck Premium)
Definition at line 362 of file projectfile.h.
References mBughunting.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Definition at line 269 of file projectfile.h.
References mBuildDir.
Referenced by MainWindow::newProjectFile(), and ProjectFileDialog::saveToProjectFile().
|
inline |
Cert C: int precision.
Definition at line 383 of file projectfile.h.
References mCertIntPrecision.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Definition at line 98 of file projectfile.h.
References mCheckHeaders.
Referenced by ProjectFileDialog::saveToProjectFile().
void ProjectFile::setCheckLevel | ( | ProjectFile::CheckLevel | checkLevel | ) |
CheckLevel: normal/exhaustive.
Definition at line 795 of file projectfile.cpp.
References mCheckLevel.
Referenced by ProjectFileDialog::saveToProjectFile().
void ProjectFile::setCheckPaths | ( | const QStringList & | paths | ) |
Set list of paths to check.
paths | List of paths. |
Definition at line 740 of file projectfile.cpp.
References mPaths.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Definition at line 106 of file projectfile.h.
References mCheckUnusedTemplates.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Definition at line 221 of file projectfile.h.
References mClangAnalyzer.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Definition at line 229 of file projectfile.h.
References mClangTidy.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Set list of coding standards (checked by Cppcheck Premium).
codingStandards | List of coding standards. |
Definition at line 378 of file projectfile.h.
References mCodingStandards.
Referenced by ProjectFileDialog::saveToProjectFile().
void ProjectFile::setDefines | ( | const QStringList & | defines | ) |
Set list of defines.
defines | List of defines. |
Definition at line 730 of file projectfile.cpp.
References mDefines.
Referenced by ProjectFileDialog::saveToProjectFile().
void ProjectFile::setExcludedPaths | ( | const QStringList & | paths | ) |
Set list of paths to exclude from the check.
paths | List of paths. |
Definition at line 745 of file projectfile.cpp.
References mExcludedPaths.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Set filename for the project file.
filename | Filename to use. |
Definition at line 401 of file projectfile.h.
References mFilename.
Referenced by MainWindow::newProjectFile().
|
inline |
Definition at line 273 of file projectfile.h.
References mImportProject.
Referenced by ProjectFileDialog::saveToProjectFile().
void ProjectFile::setIncludes | ( | const QStringList & | includes | ) |
Set list of includes.
includes | List of defines. |
Definition at line 725 of file projectfile.cpp.
References mIncludeDirs.
Referenced by ProjectFileDialog::saveToProjectFile().
void ProjectFile::setLibraries | ( | const QStringList & | libraries | ) |
Set list of libraries.
libraries | List of libraries. |
Definition at line 750 of file projectfile.cpp.
References mLibraries.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Definition at line 241 of file projectfile.h.
References CTU::maxCtuDepth, and mMaxCtuDepth.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Definition at line 249 of file projectfile.h.
References mMaxTemplateRecursion.
Referenced by ProjectFileDialog::saveToProjectFile().
void ProjectFile::setPlatform | ( | const QString & | platform | ) |
Set platform.
platform | platform. |
Definition at line 755 of file projectfile.cpp.
References mPlatform.
Referenced by ProjectFileDialog::saveToProjectFile().
|
inline |
Definition at line 178 of file projectfile.h.
References mProjectName.
Referenced by MainWindow::newProjectFile(), and ComplianceReportDialog::save().
|
inline |
Set project root path.
rootpath | new project root path. |
Definition at line 265 of file projectfile.h.
References mRootPath.
Referenced by ProjectFileDialog::saveToProjectFile().
void ProjectFile::setSuppressions | ( | const QList< SuppressionList::Suppression > & | suppressions | ) |
Set list of suppressions.
suppressions | List of suppressions. |
Definition at line 775 of file projectfile.cpp.
References mSuppressions.
Referenced by ProjectFileDialog::saveToProjectFile(), and MainWindow::suppressIds().
|
inline |
Set tags.
tags | tag list |
Definition at line 351 of file projectfile.h.
References mTags.
Referenced by ProjectFileDialog::saveToProjectFile().
void ProjectFile::setUndefines | ( | const QStringList & | undefines | ) |
Set list of undefines.
undefines | List of undefines. |
Definition at line 735 of file projectfile.cpp.
References mUndefines.
Referenced by ProjectFileDialog::saveToProjectFile().
void ProjectFile::setVSConfigurations | ( | const QStringList & | vsConfigs | ) |
Set list of Visual Studio configurations to be checked.
vsConfigs | List of configurations |
Definition at line 790 of file projectfile.cpp.
References mVsConfigurations.
Referenced by ProjectFileDialog::saveToProjectFile().
void ProjectFile::setWarningTags | ( | std::size_t | hash, |
const QString & | tags | ||
) |
Set tags for a warning.
Definition at line 805 of file projectfile.cpp.
References mWarningTags.
Referenced by ResultsTree::tagSelectedItems().
bool ProjectFile::write | ( | const QString & | filename = QString() | ) |
Write project file (to disk).
filename | Filename to use. |
Definition at line 819 of file projectfile.cpp.
References CppcheckXml::AddonElementName, CppcheckXml::AddonsElementName, CppcheckXml::AnalyzeAllVsConfigsElementName, bool_to_string(), CppcheckXml::BughuntingElementName, CppcheckXml::BuildDirElementName, CppcheckXml::CertIntPrecisionElementName, CppcheckXml::CheckHeadersElementName, CppcheckXml::CheckLevelExhaustiveElementName, CppcheckXml::CheckUnknownFunctionReturn, CppcheckXml::CheckUnusedTemplatesElementName, CLANG_ANALYZER, CLANG_TIDY, clangParser, CppcheckXml::CodingStandardElementName, CppcheckXml::CodingStandardsElementName, CppcheckXml::DefineName, CppcheckXml::DefineNameAttrib, CppcheckXml::DefinesElementName, CppcheckXml::DirElementName, CppcheckXml::DirNameAttrib, CppcheckXml::ExcludeElementName, CppcheckXml::ExcludePathName, CppcheckXml::ExcludePathNameAttrib, exhaustive, CppcheckXml::HashAttributeName, CppcheckXml::ImportProjectElementName, CppcheckXml::IncludeDirElementName, CppcheckXml::LibrariesElementName, CppcheckXml::LibraryElementName, mAddons, mAnalyzeAllVsConfigs, CppcheckXml::MaxCtuDepthElementName, CppcheckXml::MaxTemplateRecursionElementName, mBughunting, mBuildDir, mCertIntPrecision, mCheckHeaders, mCheckLevel, mCheckUnknownFunctionReturn, mCheckUnusedTemplates, mClangAnalyzer, mClangTidy, mCodingStandards, mDefines, mExcludedPaths, mFilename, mImportProject, mIncludeDirs, mLibraries, mMaxCtuDepth, mMaxTemplateRecursion, mPaths, mPlatform, mProjectName, mRootPath, mSuppressions, mTags, mUndefines, mVsConfigurations, mWarningTags, CppcheckXml::Name, CppcheckXml::Parser, CppcheckXml::PathName, CppcheckXml::PathNameAttrib, CppcheckXml::PathsElementName, CppcheckXml::PlatformElementName, CppcheckXml::ProjectElementName, CppcheckXml::ProjectFileVersion, CppcheckXml::ProjectNameElementName, CppcheckXml::ProjectVersionAttrib, CppcheckXml::RootPathName, CppcheckXml::RootPathNameAttrib, safeChecks, ProjectFile::SafeChecks::saveToXml(), CppcheckXml::SuppressionElementName, CppcheckXml::SuppressionsElementName, CppcheckXml::TagAttributeName, CppcheckXml::TagElementName, CppcheckXml::TagsElementName, CppcheckXml::TagWarningsElementName, CppcheckXml::ToolElementName, CppcheckXml::ToolsElementName, CppcheckXml::UndefineName, CppcheckXml::UndefinesElementName, CppcheckXml::VSConfigurationElementName, CppcheckXml::VSConfigurationName, CppcheckXml::WarningElementName, and writeStringList().
Referenced by MainWindow::editProjectFile(), ProjectFileDialog::ok(), ComplianceReportDialog::save(), ResultsTree::suppressHash(), MainWindow::suppressIds(), and ResultsTree::tagSelectedItems().
|
staticprotected |
Write string list.
xmlWriter | xml writer |
stringlist | string list to write |
startelementname | name of start element |
stringelementname | name of each string element |
Definition at line 1036 of file projectfile.cpp.
Referenced by write().
bool ProjectFile::clangParser |
Use Clang parser.
Definition at line 427 of file projectfile.h.
Referenced by clear(), MainWindow::getCppcheckSettings(), ProjectFileDialog::loadFromProjectFile(), read(), ProjectFileDialog::saveToProjectFile(), and write().
|
staticprivate |
Definition at line 645 of file projectfile.h.
Referenced by getActiveProject(), setActiveProject(), and ~ProjectFile().
|
private |
List of addons.
Definition at line 603 of file projectfile.h.
Referenced by clear(), getAddons(), getAddonsAndTools(), read(), setAddons(), and write().
|
private |
Should all visual studio configurations be analyzed? If this is false then only the Debug configuration for the set platform is analyzed.
Definition at line 549 of file projectfile.h.
Referenced by clear(), getAnalyzeAllVsConfigs(), read(), setAnalyzeAllVsConfigs(), and write().
|
private |
Definition at line 605 of file projectfile.h.
Referenced by clear(), getBughunting(), read(), setBughunting(), and write().
|
private |
Cppcheck build dir.
Definition at line 539 of file projectfile.h.
Referenced by clear(), getBuildDir(), readBuildDir(), setBuildDir(), and write().
|
private |
Cppcheck Premium: This value is passed to the Cert C checker if that is enabled.
Definition at line 619 of file projectfile.h.
Referenced by clear(), getCertIntPrecision(), read(), setCertIntPrecision(), and write().
|
private |
Check code in headers.
Definition at line 555 of file projectfile.h.
Referenced by clear(), getCheckHeaders(), read(), setCheckHeaders(), and write().
|
private |
Should Cppcheck run normal or exhaustive analysis?
Definition at line 608 of file projectfile.h.
Referenced by clear(), isCheckLevelExhaustive(), read(), setCheckLevel(), and write().
|
private |
Definition at line 643 of file projectfile.h.
Referenced by clear(), getCheckUnknownFunctionReturn(), read(), and write().
|
private |
Check code in unused templates.
Definition at line 558 of file projectfile.h.
Referenced by clear(), getCheckUnusedTemplates(), read(), setCheckUnusedTemplates(), and write().
|
private |
Execute clang analyzer?
Definition at line 622 of file projectfile.h.
Referenced by clear(), getAddonsAndTools(), read(), setClangAnalyzer(), and write().
|
private |
Execute clang-tidy?
Definition at line 625 of file projectfile.h.
Referenced by clear(), getAddonsAndTools(), getClangTidy(), read(), setClangTidy(), and write().
|
private |
List of coding standards, checked by Cppcheck Premium.
Definition at line 613 of file projectfile.h.
Referenced by clear(), getCodingStandards(), read(), setCodingStandards(), and write().
|
private |
List of defines.
Definition at line 568 of file projectfile.h.
Referenced by clear(), getDefines(), readDefines(), setDefines(), and write().
|
private |
Paths excluded from the check.
Definition at line 583 of file projectfile.h.
Referenced by clear(), getExcludedPaths(), readExcludes(), setExcludedPaths(), and write().
|
private |
Filename (+path) of the project file.
Definition at line 528 of file projectfile.h.
Referenced by getCheckingSuppressions(), getFilename(), read(), setFilename(), and write().
|
private |
Visual studio project/solution , compile database.
Definition at line 542 of file projectfile.h.
Referenced by clear(), getImportProject(), readImportProject(), setImportProject(), and write().
|
private |
List of include directories used to search include files.
Definition at line 563 of file projectfile.h.
Referenced by clear(), getIncludeDirs(), readIncludeDirs(), setIncludes(), and write().
|
private |
List of libraries.
Definition at line 588 of file projectfile.h.
Referenced by clear(), getLibraries(), read(), setLibraries(), and write().
|
private |
Max CTU depth.
Definition at line 638 of file projectfile.h.
Referenced by clear(), getMaxCtuDepth(), read(), setMaxCtuDepth(), and write().
|
private |
Max template instantiation recursion.
Definition at line 641 of file projectfile.h.
Referenced by clear(), getMaxTemplateRecursion(), read(), setMaxTemplateRecursion(), and write().
|
private |
List of paths to check.
Definition at line 578 of file projectfile.h.
Referenced by clear(), getCheckPaths(), readCheckPaths(), setCheckPaths(), and write().
|
private |
Definition at line 593 of file projectfile.h.
Referenced by clear(), getPlatform(), readPlatform(), setPlatform(), and write().
|
private |
Project name, used when generating compliance report.
Definition at line 616 of file projectfile.h.
Referenced by clear(), getProjectName(), read(), setProjectName(), and write().
|
private |
Root path (optional) for the project.
This is the project root path. If it is present then all relative paths in the project file are relative to this path. Otherwise paths are relative to project file's path.
Definition at line 536 of file projectfile.h.
Referenced by clear(), getRootPath(), readRootPath(), setRootPath(), and write().
|
private |
List of suppressions.
Definition at line 598 of file projectfile.h.
Referenced by addSuppression(), clear(), getCheckingSuppressions(), getSuppressions(), readSuppressions(), setSuppressions(), and write().
|
private |
|
private |
List of undefines.
Definition at line 573 of file projectfile.h.
Referenced by clear(), getUndefines(), read(), setUndefines(), and write().
|
private |
Check only a selected VS configuration.
Definition at line 552 of file projectfile.h.
Referenced by clear(), getVsConfigurations(), readVsConfigurations(), setVSConfigurations(), and write().
|
private |
Warning tags.
Definition at line 635 of file projectfile.h.
Referenced by clear(), getWarningTags(), readTagWarnings(), setWarningTags(), and write().
SafeChecks ProjectFile::safeChecks |
Definition at line 414 of file projectfile.h.
Referenced by clear(), MainWindow::getCppcheckSettings(), ProjectFileDialog::loadFromProjectFile(), read(), ProjectFileDialog::saveToProjectFile(), and write().