Cppcheck
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ImportProject Class Reference

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
 
ImportProjectoperator= (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< FileSettingsfileSettings
 
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
 

Detailed Description

Importing project settings.

Definition at line 52 of file importproject.h.

Member Enumeration Documentation

◆ Type

enum ImportProject::Type
strong
Enumerator
NONE 
UNKNOWN 
MISSING 
FAILURE 
COMPILE_DB 
VS_SLN 
VS_VCXPROJ 
BORLAND 
CPPCHECK_GUI 

Definition at line 54 of file importproject.h.

Constructor & Destructor Documentation

◆ ImportProject() [1/2]

ImportProject::ImportProject ( )
default

◆ ~ImportProject()

virtual ImportProject::~ImportProject ( )
virtualdefault

◆ ImportProject() [2/2]

ImportProject::ImportProject ( const ImportProject )
default

Member Function Documentation

◆ fsParseCommand()

void ImportProject::fsParseCommand ( FileSettings fs,
const std::string &  command 
)
static

◆ fsSetDefines()

void ImportProject::fsSetDefines ( FileSettings fs,
std::string  defs 
)
static

Definition at line 82 of file importproject.cpp.

References FileSettings::defines, and endsWith().

Referenced by fsParseCommand(), importBcb6Prj(), and importVcxproj().

◆ fsSetIncludePaths()

void ImportProject::fsSetIncludePaths ( FileSettings fs,
const std::string &  basepath,
const std::list< std::string > &  in,
std::map< std::string, std::string, cppcheck::stricmp > &  variables 
)
static

◆ getVSConfigs()

std::list< std::string > ImportProject::getVSConfigs ( )

Definition at line 1331 of file importproject.cpp.

References mAllVSConfigs.

Referenced by ProjectFileDialog::getProjectConfigs().

◆ ignoreOtherConfigs()

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().

◆ ignorePaths()

void ImportProject::ignorePaths ( const std::vector< std::string > &  ipaths)

◆ import()

ImportProject::Type ImportProject::import ( const std::string &  filename,
Settings settings = nullptr 
)

◆ importBcb6Prj()

bool ImportProject::importBcb6Prj ( const std::string &  projectFilename)
private

◆ importCompileCommands()

bool ImportProject::importCompileCommands ( std::istream &  istr)
protected

◆ importCppcheckGuiProject()

bool ImportProject::importCppcheckGuiProject ( std::istream &  istr,
Settings settings 
)
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().

◆ importSln()

bool ImportProject::importSln ( std::istream &  istr,
const std::string &  path,
const std::vector< std::string > &  fileFilters 
)
private

◆ importVcxproj()

bool ImportProject::importVcxproj ( const std::string &  filename,
std::map< std::string, std::string, cppcheck::stricmp > &  variables,
const std::string &  additionalIncludeDirectories,
const std::vector< std::string > &  fileFilters 
)
private

◆ operator=()

ImportProject& ImportProject::operator= ( const ImportProject )
default

◆ printError()

void ImportProject::printError ( const std::string &  message)
staticprivate

◆ selectOneVsConfig()

void ImportProject::selectOneVsConfig ( Platform::Type  platform)

◆ selectVsConfigurations()

void ImportProject::selectVsConfigurations ( Platform::Type  platform,
const std::vector< std::string > &  configurations 
)

◆ setRelativePaths()

void ImportProject::setRelativePaths ( const std::string &  filename)
private

◆ sourceFileExists()

bool ImportProject::sourceFileExists ( const std::string &  file)
protectedvirtual

Definition at line 1353 of file importproject.cpp.

References Path::isFile().

Referenced by importCompileCommands().

Member Data Documentation

◆ analyzeAllVsConfigs

std::string ImportProject::analyzeAllVsConfigs

Definition at line 85 of file importproject.h.

Referenced by CmdLineParser::parseFromArgs().

◆ checkVsConfigs

std::list<std::string> ImportProject::checkVsConfigs

Definition at line 89 of file importproject.h.

◆ excludedPaths

std::list<std::string> ImportProject::excludedPaths

Definition at line 88 of file importproject.h.

Referenced by CmdLineParser::parseFromArgs().

◆ fileSettings

std::list<FileSettings> ImportProject::fileSettings

◆ 

struct { ... } ImportProject::guiProject

◆ libraries

std::list<std::string> ImportProject::libraries

Definition at line 87 of file importproject.h.

Referenced by CmdLineParser::parseFromArgs().

◆ mAllVSConfigs

std::set<std::string> ImportProject::mAllVSConfigs
private

Definition at line 112 of file importproject.h.

Referenced by getVSConfigs(), and importVcxproj().

◆ mPath

std::string ImportProject::mPath
private

Definition at line 111 of file importproject.h.

Referenced by ignorePaths(), import(), and importCppcheckGuiProject().

◆ pathNames

std::vector<std::string> ImportProject::pathNames

Definition at line 86 of file importproject.h.

Referenced by CmdLineParser::parseFromArgs().

◆ platform

std::string ImportProject::platform

◆ projectFile

std::string ImportProject::projectFile

Definition at line 90 of file importproject.h.

Referenced by CmdLineParser::parseFromArgs().

◆ projectType

Type ImportProject::projectType {Type::NONE}

Definition at line 71 of file importproject.h.

Referenced by CmdLineParser::parseFromArgs().


The documentation for this class was generated from the following files: