Added license text to errormessage.h (via code tha generates it) and also mention that it is generated by machine

This commit is contained in:
Reijo Tomperi 2009-01-08 20:51:07 +00:00
parent 2a2adb037a
commit 4dfc3a9c3d
2 changed files with 42 additions and 1 deletions

View File

@ -1,3 +1,23 @@
/*
* cppcheck - c/c++ syntax checking
* Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam
*
* 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/
*/
// THIS FILE IS GENERATED BY MACHINE, SEE ../tools/errmsg.cpp !
#ifndef errormessageH
#define errormessageH
#include <string>
@ -6,8 +26,10 @@ class Token;
class Tokenizer;
class ErrorMessage
{
public:
private:
ErrorMessage() { }
static std::string msg1(const Tokenizer *tokenizer, const Token *Location);
public:
static std::string memleak(const Tokenizer *tokenizer, const Token *Location, const std::string &varname)
{ return msg1(tokenizer, Location) + "Memory leak: " + varname + ""; }

View File

@ -106,6 +106,25 @@ int main()
// Generate code..
std::cout << "Generate code.." << std::endl;
std::ofstream fout("errormessage.h");
fout << "/*\n";
fout << " * cppcheck - c/c++ syntax checking\n";
fout << " * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam\n";
fout << " *\n";
fout << " * This program is free software: you can redistribute it and/or modify\n";
fout << " * it under the terms of the GNU General Public License as published by\n";
fout << " * the Free Software Foundation, either version 3 of the License, or\n";
fout << " * (at your option) any later version.\n";
fout << " *\n";
fout << " * This program is distributed in the hope that it will be useful,\n";
fout << " * but WITHOUT ANY WARRANTY; without even the implied warranty of\n";
fout << " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n";
fout << " * GNU General Public License for more details.\n";
fout << " *\n";
fout << " * You should have received a copy of the GNU General Public License\n";
fout << " * along with this program. If not, see <http://www.gnu.org/licenses/\n";
fout << " */\n\n";
fout << "// THIS FILE IS GENERATED BY MACHINE, SEE ../tools/errmsg.cpp !\n\n";
fout << "#ifndef errormessageH\n";
fout << "#define errormessageH\n";
fout << "#include <string>\n";