2016-08-13 10:50:03 +02:00
|
|
|
/*
|
|
|
|
* Cppcheck - A tool for static C/C++ code analysis
|
|
|
|
* Copyright (C) 2007-2016 Cppcheck team.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
#ifndef importprojectH
|
|
|
|
#define importprojectH
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2016-12-06 20:02:43 +01:00
|
|
|
#include "config.h"
|
|
|
|
#include "platform.h"
|
2016-08-13 10:50:03 +02:00
|
|
|
#include <list>
|
2016-11-11 16:22:14 +01:00
|
|
|
#include <map>
|
2016-08-13 10:50:03 +02:00
|
|
|
#include <string>
|
|
|
|
#include <set>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
/// @addtogroup Core
|
|
|
|
/// @{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Importing project settings.
|
|
|
|
*/
|
|
|
|
class CPPCHECKLIB ImportProject {
|
|
|
|
public:
|
|
|
|
/** File settings. Multiple configurations for a file is allowed. */
|
|
|
|
struct FileSettings {
|
|
|
|
FileSettings() : platformType(cppcheck::Platform::Unspecified) {}
|
|
|
|
std::string cfg;
|
|
|
|
std::string filename;
|
|
|
|
std::string defines;
|
|
|
|
std::set<std::string> undefs;
|
|
|
|
std::list<std::string> includePaths;
|
|
|
|
cppcheck::Platform::PlatformType platformType;
|
|
|
|
|
|
|
|
void setDefines(std::string defs);
|
2016-11-11 16:22:14 +01:00
|
|
|
void setIncludePaths(const std::string &basepath, const std::list<std::string> &in, const std::map<std::string, std::string> &variables);
|
2016-08-13 10:50:03 +02:00
|
|
|
};
|
|
|
|
std::list<FileSettings> fileSettings;
|
|
|
|
|
2016-12-06 20:02:43 +01:00
|
|
|
void ignorePaths(const std::vector<std::string> &ipaths);
|
2016-08-21 15:57:38 +02:00
|
|
|
void ignoreOtherConfigs(const std::string &cfg);
|
2016-08-20 13:47:25 +02:00
|
|
|
void ignoreOtherPlatforms(cppcheck::Platform::PlatformType platformType);
|
2016-08-13 10:50:03 +02:00
|
|
|
|
|
|
|
void import(const std::string &filename);
|
|
|
|
private:
|
|
|
|
void importCompileCommands(std::istream &istr);
|
|
|
|
void importSln(std::istream &istr, const std::string &path);
|
2016-12-04 18:50:59 +01:00
|
|
|
void importVcxproj(const std::string &filename, std::map<std::string, std::string> variables, const std::string &additionalIncludeDirectories);
|
2016-08-13 10:50:03 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/// @}
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
#endif // importprojectH
|