资源简介
Cppcheck是一种C/C++代码缺陷静态检查工具。不同于C/C++编译器及其它分析工具,Cppcheck只检查编译器检查不出来的bug,不检查语法错误。她是开源的.
代码片段和文件信息
/*
* Cppcheck - A tool for static C/C++ code analysis
* Copyright (C) 2007-2012 Daniel Marjamäki and 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 .
*/
#include
#include
#include
#include
#include
#include // EXIT_FAILURE
#include “cppcheck.h“
#include “timer.h“
#include “settings.h“
#include “cmdlineparser.h“
#include “path.h“
#include “filelister.h“
#ifdef HAVE_RULES
// xml is used in rules
#include l.h>
#endif
static void AddFilesToList(const std::string& FileList std::vector& PathNames)
{
// to keep things initially simple if the file can‘t be opened just be
// silent and move on
// ideas : we could also require this should be an xml file with the filenames
// specified in an xml structure
// we could elaborate this then to also include the I-paths ...
// basically for everything that makes the command line very long
// xml is a bonus then since we can easily extend it
// we need a good parser then -> suggestion : Tinyxml
// drawback : creates a dependency
std::istream *Files;
std::ifstream Infile;
if (FileList.compare(“-“) == 0) { // read from stdin
Files = &std::cin;
} else {
Infile.open(FileList.c_str());
Files = &Infile;
}
if (Files) {
std::string FileName;
while (std::getline(*Files FileName)) { // next line
if (!FileName.empty()) {
PathNames.push_back(FileName);
}
}
}
}
static void AddInclPathsToList(const std::string& FileList std::list& PathNames)
{
// to keep things initially simple if the file can‘t be opened just be
// silent and move on
std::ifstream Files(FileList.c_str());
if (Files) {
std::string PathName;
while (std::getline(Files PathName)) { // next line
if (!PathName.empty()) {
PathName = Path::fromNativeSeparators(PathName);
PathName = Path::removeQuotationMarks(PathName);
PathNames.push_back(PathName);
}
}
}
}
CmdLineParser::CmdLineParser(Settings *settings)
: _settings(settings)
_showHelp(false)
_showVersion(false)
_showErrorMessages(fa
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 326 2012-01-01 13:29 cppcheckSourceCode\.git\config
文件 73 2012-01-01 13:24 cppcheckSourceCode\.git\desc
文件 23 2012-01-01 13:29 cppcheckSourceCode\.git\HEAD
文件 452 2012-01-01 13:24 cppcheckSourceCode\.git\hooks\applypatch-msg.sample
文件 896 2012-01-01 13:24 cppcheckSourceCode\.git\hooks\commit-msg.sample
文件 160 2012-01-01 13:24 cppcheckSourceCode\.git\hooks\post-commit.sample
文件 552 2012-01-01 13:24 cppcheckSourceCode\.git\hooks\post-receive.sample
文件 189 2012-01-01 13:24 cppcheckSourceCode\.git\hooks\post-update.sample
文件 398 2012-01-01 13:24 cppcheckSourceCode\.git\hooks\pre-applypatch.sample
文件 1704 2012-01-01 13:24 cppcheckSourceCode\.git\hooks\pre-commit.sample
文件 4951 2012-01-01 13:24 cppcheckSourceCode\.git\hooks\pre-reba
文件 1239 2012-01-01 13:24 cppcheckSourceCode\.git\hooks\prepare-commit-msg.sample
文件 3611 2012-01-01 13:24 cppcheckSourceCode\.git\hooks\update.sample
文件 31680 2012-01-01 13:29 cppcheckSourceCode\.git\index
文件 240 2012-01-01 13:24 cppcheckSourceCode\.git\info\exclude
文件 195 2012-01-01 13:29 cppcheckSourceCode\.git\logs\HEAD
文件 195 2012-01-01 13:29 cppcheckSourceCode\.git\logs\refs\heads\master
文件 1171948 2012-01-01 13:29 cppcheckSourceCode\.git\ob
文件 9837460 2012-01-01 13:29 cppcheckSourceCode\.git\ob
文件 1734 2012-01-01 13:29 cppcheckSourceCode\.git\packed-refs
文件 41 2012-01-01 13:29 cppcheckSourceCode\.git\refs\heads\master
文件 32 2012-01-01 13:29 cppcheckSourceCode\.git\refs\remotes\origin\HEAD
文件 706 2012-01-01 13:29 cppcheckSourceCode\.gitignore
文件 392 2012-01-01 13:29 cppcheckSourceCode\AUTHORS
文件 1604 2012-01-01 13:29 cppcheckSourceCode\build-pcre.txt
文件 1554 2012-01-01 13:29 cppcheckSourceCode\build.bat
文件 1356651 2012-01-01 13:29 cppcheckSourceCode\Changelog
文件 1278 2012-01-01 13:29 cppcheckSourceCode\cli\cli.pro
文件 35430 2012-01-01 13:29 cppcheckSourceCode\cli\cmdlineparser.cpp
文件 3089 2012-01-01 13:29 cppcheckSourceCode\cli\cmdlineparser.h
............此处省略405个文件信息
相关资源
- c++课程设计-----股票交易系统源代码
- Visual C++视频技术方案宝典的光盘源代
- 计算机图形学实践教程随书源代码
- 上期CTP_API_C++可实盘多合约多策略版本
- 上期CTP_API_C++可实盘多合约多策略版本
- 孔令德 计算机图形学基础教程visual
- Essential C++中文版+完整源代码+习题答
- C++学习实用实践项目源代码
- Visual C++实践与提高-COM和COM+篇高清p
- VC6.0+ACCESS图书管理系统源代码
- 程序设计抽象思想:C语言描述-带书签
- C++虚拟数字键盘 源代码 可扩展
- 剑指offer+50道源代码
- 3D三角形网格模型补洞源代码
- The Art of Scientific Computing第二版、第三
- 浏览器截屏程序源代码C++
- 单片机C语言程序设计实训100例 案例
- C语言游戏编程从入门到精通PDF书及源
- TeeChart Pro Activex control v8 源代码
- 背单词软件源代码(使用C++和Qt库编写
- 基于opencv和MFC的多功能视频、图像处
- 编译原理LL1语法分析器C++版源代码
- C++餐厅管理系统源代码
- mqtt-client MFC工程调用开源代码
- PL/0语言编译器源代码及测试代码
- Cocos2d-x实战:C++卷2版源代码
- vc++ 编程宝典(十年典藏版) 书后光
- Visual C++网络编程郑阿奇源代码+PPT
- 编译原理词法分析器实验报告含源代
- C++程序设计经典300例源代码
评论
共有 条评论