From 113b3c1d21af31ebdd1201d3e35527911f480957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 6 Mar 2009 17:38:47 +0100 Subject: [PATCH] auto-deallocated classes: added command line option for specifying .lst file (http://apps.sourceforge.net/trac/cppcheck/ticket/120) --- src/cppcheck.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/cppcheck.cpp b/src/cppcheck.cpp index dada4838d..7cf7fba4c 100644 --- a/src/cppcheck.cpp +++ b/src/cppcheck.cpp @@ -195,6 +195,20 @@ std::string CppCheck::parseFromArgs(int argc, const char* const argv[]) } } + // auto deallocated classes.. + else if (strcmp(argv[i], "--auto-dealloc")==0) + { + ++i; + + if (i >= argc || !strstr(argv[i],".lst")) + return "No .lst file specified for the --auto-dealloc option\n"; + + std::ifstream f(argv[i]); + if (!f.is_open()) + return "couldn't open the file \"" + std::string(argv[i+1]) + "\"\n"; + _settings.autoDealloc(f); + } + else if (strncmp(argv[i], "-", 1) == 0 || strncmp(argv[i], "--", 2) == 0) { return "cppcheck: error: unrecognized command line option \"" + std::string(argv[i]) + "\"\n";