| 
    Cppcheck
    
   | 
 
Importing project settings. More...
#include <importproject.h>
Public Types | |
| enum class | Type {  NONE , UNKNOWN , MISSING , FAILURE , COMPILE_DB , VS_SLN , VS_VCXPROJ , BORLAND , CPPCHECK_GUI }  | 
Public Member Functions | |
| ImportProject ()=default | |
| virtual | ~ImportProject ()=default | 
| ImportProject (const ImportProject &)=default | |
| ImportProject & | operator= (const ImportProject &)=default | 
| void | selectOneVsConfig (Platform::Type platform) | 
| void | selectVsConfigurations (Platform::Type platform, const std::vector< std::string > &configurations) | 
| std::list< std::string > | getVSConfigs () | 
| void | ignorePaths (const std::vector< std::string > &ipaths) | 
| void | ignoreOtherConfigs (const std::string &cfg) | 
| Type | import (const std::string &filename, Settings *settings=nullptr) | 
Static Public Member Functions | |
| static void | fsParseCommand (FileSettings &fs, const std::string &command) | 
| static void | fsSetDefines (FileSettings &fs, std::string defs) | 
| static void | fsSetIncludePaths (FileSettings &fs, const std::string &basepath, const std::list< std::string > &in, std::map< std::string, std::string, cppcheck::stricmp > &variables) | 
Public Attributes | |
| std::list< FileSettings > | fileSettings | 
| Type | projectType {Type::NONE} | 
| struct { | |
| std::string analyzeAllVsConfigs | |
| std::vector< std::string > pathNames | |
| std::list< std::string > libraries | |
| std::list< std::string > excludedPaths | |
| std::list< std::string > checkVsConfigs | |
| std::string projectFile | |
| std::string platform | |
| } | guiProject | 
Protected Member Functions | |
| bool | importCompileCommands (std::istream &istr) | 
| bool | importCppcheckGuiProject (std::istream &istr, Settings *settings) | 
| virtual bool | sourceFileExists (const std::string &file) | 
Private Member Functions | |
| bool | importSln (std::istream &istr, const std::string &path, const std::vector< std::string > &fileFilters) | 
| bool | importVcxproj (const std::string &filename, std::map< std::string, std::string, cppcheck::stricmp > &variables, const std::string &additionalIncludeDirectories, const std::vector< std::string > &fileFilters) | 
| bool | importBcb6Prj (const std::string &projectFilename) | 
| void | setRelativePaths (const std::string &filename) | 
Static Private Member Functions | |
| static void | printError (const std::string &message) | 
Private Attributes | |
| std::string | mPath | 
| std::set< std::string > | mAllVSConfigs | 
Importing project settings.
Definition at line 52 of file importproject.h.
      
  | 
  strong | 
| Enumerator | |
|---|---|
| NONE | |
| UNKNOWN | |
| MISSING | |
| FAILURE | |
| COMPILE_DB | |
| VS_SLN | |
| VS_VCXPROJ | |
| BORLAND | |
| CPPCHECK_GUI | |
Definition at line 54 of file importproject.h.
      
  | 
  default | 
      
  | 
  virtualdefault | 
      
  | 
  default | 
      
  | 
  static | 
Definition at line 270 of file importproject.cpp.
References endsWith(), fsSetDefines(), FileSettings::includePaths, readUntil(), FileSettings::standard, startsWith(), FileSettings::systemIncludePaths, FileSettings::undefs, and unescape().
Referenced by importCompileCommands().
      
  | 
  static | 
Definition at line 82 of file importproject.cpp.
References FileSettings::defines, and endsWith().
Referenced by fsParseCommand(), importBcb6Prj(), and importVcxproj().
      
  | 
  static | 
Definition at line 144 of file importproject.cpp.
References endsWith(), Path::fromNativeSeparators(), FileSettings::includePaths, Path::simplifyPath(), simplifyPathWithVariables(), and startsWith().
Referenced by importBcb6Prj(), importCompileCommands(), and importVcxproj().
| std::list< std::string > ImportProject::getVSConfigs | ( | ) | 
Definition at line 1331 of file importproject.cpp.
References mAllVSConfigs.
Referenced by ProjectFileDialog::getProjectConfigs().
| void ImportProject::ignoreOtherConfigs | ( | const std::string & | cfg | ) | 
Definition at line 72 of file importproject.cpp.
References cfg(), and fileSettings.
Referenced by MainWindow::analyzeFiles(), and CmdLineParser::parseFromArgs().
| void ImportProject::ignorePaths | ( | const std::vector< std::string > & | ipaths | ) | 
Definition at line 44 of file importproject.cpp.
References fileSettings, Path::isAbsolute(), isValidGlobPattern(), matchglob(), and mPath.
Referenced by MainWindow::doAnalyzeProject(), CmdLineParser::parseFromArgs(), and ComplianceReportDialog::save().
| ImportProject::Type ImportProject::import | ( | const std::string & | filename, | 
| Settings * | settings = nullptr  | 
        ||
| ) | 
Definition at line 180 of file importproject.cpp.
References BORLAND, COMPILE_DB, CPPCHECK_GUI, emptyString, endsWith(), FAILURE, Settings::fileFilters, Path::fromNativeSeparators(), Path::getPathFromFilename(), importBcb6Prj(), importCompileCommands(), importCppcheckGuiProject(), importSln(), importVcxproj(), MISSING, mPath, setRelativePaths(), UNKNOWN, VS_SLN, and VS_VCXPROJ.
Referenced by MainWindow::analyzeFiles(), MainWindow::analyzeProject(), ProjectFileDialog::getProjectConfigs(), CmdLineParser::parseFromArgs(), and ComplianceReportDialog::save().
      
  | 
  private | 
Definition at line 802 of file importproject.cpp.
References Path::acceptFile(), error, fileSettings, fsSetDefines(), fsSetIncludePaths(), Path::getFilenameExtensionInLowerCase(), Path::getPathFromFilename(), Path::isAbsolute(), printError(), Path::simplifyPath(), and toStringList().
Referenced by import().
      
  | 
  protected | 
Definition at line 343 of file importproject.cpp.
References Path::acceptFile(), endsWith(), fileSettings, Path::fromNativeSeparators(), fsParseCommand(), fsSetIncludePaths(), Path::isAbsolute(), printError(), Path::simplifyPath(), and sourceFileExists().
Referenced by import().
      
  | 
  protected | 
Definition at line 1106 of file importproject.cpp.
References CppcheckXml::AddonElementName, Settings::addons, CppcheckXml::AddonsElementName, CppcheckXml::AnalyzeAllVsConfigsElementName, Settings::basePaths, CppcheckXml::BughuntingElementName, Settings::buildDir, CppcheckXml::BuildDirElementName, CppcheckXml::CertIntPrecisionElementName, Settings::checkHeaders, CppcheckXml::CheckHeadersElementName, CppcheckXml::CheckLevelExhaustiveElementName, CppcheckXml::CheckUnknownFunctionReturn, Settings::checkUnusedTemplates, CppcheckXml::CheckUnusedTemplatesElementName, Settings::clang, CppcheckXml::ClangTidy, Settings::clangTidy, Settings::SafeChecks::classes, CppcheckXml::CodingStandardElementName, CppcheckXml::CodingStandardsElementName, CppcheckXml::DefineName, CppcheckXml::DefineNameAttrib, CppcheckXml::DefinesElementName, CppcheckXml::DirElementName, CppcheckXml::DirNameAttrib, emptyString, error, SuppressionList::Suppression::errorId, CppcheckXml::ExcludeElementName, CppcheckXml::ExcludePathName, CppcheckXml::ExcludePathNameAttrib, Settings::SafeChecks::externalFunctions, Settings::SafeChecks::externalVariables, SuppressionList::Suppression::fileName, CppcheckXml::FunctionContracts, guiProject, SuppressionList::Suppression::hash, CppcheckXml::IgnoreElementName, CppcheckXml::IgnorePathName, CppcheckXml::IgnorePathNameAttrib, CppcheckXml::ImportProjectElementName, CppcheckXml::IncludeDirElementName, Settings::includePaths, Settings::SafeChecks::internalFunctions, istream_to_string(), join(), joinRelativePath(), CppcheckXml::LibrariesElementName, CppcheckXml::LibraryElementName, SuppressionList::Suppression::lineNumber, Settings::maxCtuDepth, CppcheckXml::MaxCtuDepthElementName, Settings::maxTemplateRecursion, CppcheckXml::MaxTemplateRecursionElementName, mPath, SuppressionList::Suppression::NO_LINE, Settings::normal, CppcheckXml::Parser, CppcheckXml::PathName, CppcheckXml::PathNameAttrib, CppcheckXml::PathsElementName, CppcheckXml::PlatformElementName, Settings::premiumArgs, printError(), CppcheckXml::ProjectElementName, CppcheckXml::ProjectNameElementName, readSafe(), readXmlStringList(), Settings::relativePaths, CppcheckXml::RootPathName, CppcheckXml::RootPathNameAttrib, Settings::safeChecks, Settings::setCheckLevel(), CppcheckXml::SuppressionElementName, CppcheckXml::SuppressionsElementName, SuppressionList::Suppression::symbolName, CppcheckXml::TagElementName, CppcheckXml::TagsElementName, CppcheckXml::TagWarningsElementName, CppcheckXml::ToolElementName, CppcheckXml::ToolsElementName, CppcheckXml::UndefineName, CppcheckXml::UndefinesElementName, Settings::userDefines, Settings::userUndefs, CppcheckXml::VariableContractsElementName, CppcheckXml::VSConfigurationElementName, CppcheckXml::VSConfigurationName, Settings::SafeChecks::XmlClasses, Settings::SafeChecks::XmlExternalFunctions, Settings::SafeChecks::XmlExternalVariables, Settings::SafeChecks::XmlInternalFunctions, and Settings::SafeChecks::XmlRootName.
Referenced by import().
      
  | 
  private | 
Definition at line 427 of file importproject.cpp.
References emptyString, Path::fromNativeSeparators(), importVcxproj(), Path::isAbsolute(), printError(), startsWith(), and Path::toNativeSeparators().
Referenced by import().
      
  | 
  private | 
Definition at line 684 of file importproject.cpp.
References Path::acceptFile(), FileSettings::cfg, cfg(), error, fileSettings, fsSetDefines(), fsSetIncludePaths(), Standards::getCPP(), Path::getPathFromFilename(), guiProject, importPropertyGroup(), Path::isAbsolute(), loadVisualStudioProperties(), mAllVSConfigs, matchglobs(), printError(), Path::simplifyPath(), and toStringList().
Referenced by import(), and importSln().
      
  | 
  default | 
      
  | 
  staticprivate | 
Definition at line 1348 of file importproject.cpp.
Referenced by importBcb6Prj(), importCompileCommands(), importCppcheckGuiProject(), importSln(), and importVcxproj().
| void ImportProject::selectOneVsConfig | ( | Platform::Type | platform | ) | 
Definition at line 1280 of file importproject.cpp.
References FileSettings::cfg, FileSettings::filename(), fileSettings, platform, FileSettings::platformType, and startsWith().
Referenced by CmdLineParser::parseFromArgs().
| void ImportProject::selectVsConfigurations | ( | Platform::Type | platform, | 
| const std::vector< std::string > & | configurations | ||
| ) | 
Definition at line 1307 of file importproject.cpp.
References FileSettings::cfg, fileSettings, platform, and FileSettings::platformType.
Referenced by MainWindow::doAnalyzeProject().
      
  | 
  private | 
Definition at line 1336 of file importproject.cpp.
References fileSettings, Path::fromNativeSeparators(), Path::getCurrentPath(), Path::getRelativePath(), and Path::isAbsolute().
Referenced by import().
      
  | 
  protectedvirtual | 
Definition at line 1353 of file importproject.cpp.
References Path::isFile().
Referenced by importCompileCommands().
| std::string ImportProject::analyzeAllVsConfigs | 
Definition at line 85 of file importproject.h.
Referenced by CmdLineParser::parseFromArgs().
| std::list<std::string> ImportProject::checkVsConfigs | 
Definition at line 89 of file importproject.h.
| std::list<std::string> ImportProject::excludedPaths | 
Definition at line 88 of file importproject.h.
Referenced by CmdLineParser::parseFromArgs().
| std::list<FileSettings> ImportProject::fileSettings | 
Definition at line 70 of file importproject.h.
Referenced by MainWindow::analyzeFiles(), MainWindow::doAnalyzeProject(), ignoreOtherConfigs(), ignorePaths(), importBcb6Prj(), importCompileCommands(), importVcxproj(), CmdLineParser::parseFromArgs(), ComplianceReportDialog::save(), selectOneVsConfig(), selectVsConfigurations(), ThreadResult::setProject(), and setRelativePaths().
| struct { ... } ImportProject::guiProject | 
Referenced by importCppcheckGuiProject(), importVcxproj(), and CmdLineParser::parseFromArgs().
| std::list<std::string> ImportProject::libraries | 
Definition at line 87 of file importproject.h.
Referenced by CmdLineParser::parseFromArgs().
      
  | 
  private | 
Definition at line 112 of file importproject.h.
Referenced by getVSConfigs(), and importVcxproj().
      
  | 
  private | 
Definition at line 111 of file importproject.h.
Referenced by ignorePaths(), import(), and importCppcheckGuiProject().
| std::vector<std::string> ImportProject::pathNames | 
Definition at line 86 of file importproject.h.
Referenced by CmdLineParser::parseFromArgs().
| std::string ImportProject::platform | 
Definition at line 91 of file importproject.h.
Referenced by CmdLineParser::parseFromArgs(), selectOneVsConfig(), and selectVsConfigurations().
| std::string ImportProject::projectFile | 
Definition at line 90 of file importproject.h.
Referenced by CmdLineParser::parseFromArgs().
| Type ImportProject::projectType {Type::NONE} | 
Definition at line 71 of file importproject.h.
Referenced by CmdLineParser::parseFromArgs().