From 7df3670128f793968f7d296cc3c617fc4d0f4d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 17 Jul 2009 10:49:01 +0200 Subject: [PATCH] doc: updated doxygen comments. three groups where created - 'GUI', 'Core' and 'Checks' --- gui/aboutdialog.h | 4 +- gui/applicationdialog.h | 5 +- gui/applicationlist.h | 5 +- gui/checkthread.h | 5 +- gui/common.h | 6 +- gui/csvreport.h | 6 +- gui/fileviewdialog.h | 5 +- gui/mainwindow.h | 7 +- gui/projectfile.h | 6 +- gui/report.h | 5 +- gui/resultstree.h | 6 +- gui/resultsview.h | 5 +- gui/settingsdialog.h | 4 +- gui/threadhandler.h | 6 +- gui/threadresult.h | 5 +- gui/translationhandler.h | 6 +- gui/txtreport.h | 6 +- gui/xmlreport.h | 6 +- src/check.h | 13 ++-- src/checkautovariables.h | 6 +- src/checkbufferoverrun.h | 6 +- src/checkclass.h | 5 ++ src/checkdangerousfunctions.h | 5 +- src/checkheaders.h | 6 +- src/checkmemoryleak.h | 136 ++++++++++++++++++++++++---------- src/checkother.h | 5 +- src/checkstl.h | 6 +- src/checkunusedfunctions.h | 5 +- src/cppcheck.h | 5 ++ src/errorlogger.h | 5 ++ src/filelister.h | 6 ++ src/mathlib.h | 6 ++ src/preprocessor.h | 5 ++ src/settings.h | 6 ++ src/token.h | 5 ++ src/tokenize.h | 8 +- 36 files changed, 265 insertions(+), 72 deletions(-) diff --git a/gui/aboutdialog.h b/gui/aboutdialog.h index bb4e2fcd0..39b288627 100644 --- a/gui/aboutdialog.h +++ b/gui/aboutdialog.h @@ -24,6 +24,8 @@ #include "ui_about.h" +/// @addtogroup GUI +/// @{ /** * @brief About dialog @@ -38,5 +40,5 @@ public: private: Ui::About mUI; }; - +/// @} #endif // ABOUT_DIALOG_H diff --git a/gui/applicationdialog.h b/gui/applicationdialog.h index f9b27ea8f..511054a67 100644 --- a/gui/applicationdialog.h +++ b/gui/applicationdialog.h @@ -23,6 +23,9 @@ #include #include "ui_application.h" +/// @addtogroup GUI +/// @{ + /** * @brief Dialog to edit a startable application. * User can open errors with user specified applications. This is a dialog @@ -79,5 +82,5 @@ protected: Ui::ApplicationDialog mUI; private: }; - +/// @} #endif // APPLICATIONDIALOG_H diff --git a/gui/applicationlist.h b/gui/applicationlist.h index c9212e339..8ad273022 100644 --- a/gui/applicationlist.h +++ b/gui/applicationlist.h @@ -22,6 +22,9 @@ #include #include +/// @addtogroup GUI +/// @{ + /** * @brief List of applications user has specified to open errors with @@ -159,5 +162,5 @@ protected: QList mApplications; private: }; - +/// @} #endif // APPLICATIONLIST_H diff --git a/gui/checkthread.h b/gui/checkthread.h index 1102f3e24..2e516de49 100644 --- a/gui/checkthread.h +++ b/gui/checkthread.h @@ -25,6 +25,9 @@ #include "../src/settings.h" #include "threadresult.h" +/// @addtogroup GUI +/// @{ + /** * @brief Thread to run cppcheck * @@ -91,5 +94,5 @@ protected: CppCheck mCppcheck; private: }; - +/// @} #endif // CHECKTHREAD_H diff --git a/gui/common.h b/gui/common.h index d26f3366b..33b84a8de 100644 --- a/gui/common.h +++ b/gui/common.h @@ -19,6 +19,10 @@ #ifndef COMMON_H #define COMMON_H +/// @addtogroup GUI +/// @{ + + /** * @brief List of error types to show * @@ -56,5 +60,5 @@ ShowTypes; #define SETTINGS_LANGUAGE "Application language" #define SETTINGS_TOOLBARS_SHOW "Toolbars/ShowStandard" - +/// @} #endif diff --git a/gui/csvreport.h b/gui/csvreport.h index 0576103d3..861babbab 100644 --- a/gui/csvreport.h +++ b/gui/csvreport.h @@ -26,6 +26,10 @@ #include #include "report.h" +/// @addtogroup GUI +/// @{ + + /** * @brief CSV text file report. * This report exports results as CSV (comma separated values). CSV files are @@ -68,5 +72,5 @@ private: */ QTextStream mTxtWriter; }; - +/// @} #endif // CSV_REPORT_H diff --git a/gui/fileviewdialog.h b/gui/fileviewdialog.h index e1c7786f4..55de2065b 100644 --- a/gui/fileviewdialog.h +++ b/gui/fileviewdialog.h @@ -23,6 +23,9 @@ #include #include "ui_file.h" +/// @addtogroup GUI +/// @{ + /** * @brief File view -dialog. @@ -58,5 +61,5 @@ protected: Ui::Fileview mUI; }; - +/// @} #endif // FILEVIEW_DIALOG_H diff --git a/gui/mainwindow.h b/gui/mainwindow.h index bb75bb1f2..930224199 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -34,6 +34,11 @@ #include "ui_main.h" class ThreadHandler; + +/// @addtogroup GUI +/// @{ + + /** * @brief Main window for cppcheck-gui * @@ -308,5 +313,5 @@ protected: QString mCurrentDirectory; }; - +/// @} #endif // MAINWINDOW_H diff --git a/gui/projectfile.h b/gui/projectfile.h index c20e8a2a5..01629ac9b 100644 --- a/gui/projectfile.h +++ b/gui/projectfile.h @@ -24,6 +24,10 @@ #include #include +/// @addtogroup GUI +/// @{ + + /** * @brief A class that reads and writes (TODO) project files. * The project files contain project-specific settings for checking. For @@ -85,5 +89,5 @@ private: */ QStringList mIncludeDirs; }; - +/// @} #endif // PROJECT_FILE_H diff --git a/gui/report.h b/gui/report.h index dd8ecbd04..0fd31d3dc 100644 --- a/gui/report.h +++ b/gui/report.h @@ -24,6 +24,9 @@ #include #include +/// @addtogroup GUI +/// @{ + /** * @brief A base class for reports. */ @@ -88,5 +91,5 @@ private: */ QFile mFile; }; - +/// @} #endif // REPORT_H diff --git a/gui/resultstree.h b/gui/resultstree.h index 662749b95..981252566 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -31,6 +31,10 @@ class Report; +/// @addtogroup GUI +/// @{ + + /** * @brief Cppcheck's results are shown in this tree * @@ -362,5 +366,5 @@ protected: private: }; - +/// @} #endif // RESULTSTREE_H diff --git a/gui/resultsview.h b/gui/resultsview.h index 2eb43928c..3270d378a 100644 --- a/gui/resultsview.h +++ b/gui/resultsview.h @@ -29,6 +29,9 @@ #include "report.h" #include "ui_resultsview.h" +/// @addtogroup GUI +/// @{ + /** * @brief Widget to show cppcheck progressbar and result * @@ -179,5 +182,5 @@ protected: private: }; - +/// @} #endif // RESULTSVIEW_H diff --git a/gui/settingsdialog.h b/gui/settingsdialog.h index 433290522..6b9668d1c 100644 --- a/gui/settingsdialog.h +++ b/gui/settingsdialog.h @@ -33,6 +33,8 @@ #include #include "ui_settings.h" +/// @addtogroup GUI +/// @{ /** * @brief Settings dialog @@ -186,5 +188,5 @@ protected: Ui::Settings mUI; private: }; - +/// @} #endif // SETTINGSDIALOG_H diff --git a/gui/threadhandler.h b/gui/threadhandler.h index a1c2ef3e4..75d049905 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -28,6 +28,10 @@ #include "checkthread.h" #include "resultsview.h" +/// @addtogroup GUI +/// @{ + + /** * @brief This class handles creating threadresult and starting threads * @@ -147,5 +151,5 @@ protected: int mRunningThreadCount; private: }; - +/// @} #endif // THREADHANDLER_H diff --git a/gui/threadresult.h b/gui/threadresult.h index 3224e413f..19bf3cb66 100644 --- a/gui/threadresult.h +++ b/gui/threadresult.h @@ -26,6 +26,9 @@ #include #include "../src/errorlogger.h" +/// @addtogroup GUI +/// @{ + /** * @brief Threads use this class to obtain new files to process and to publish results * @@ -125,5 +128,5 @@ protected: int mProgress; private: }; - +/// @} #endif // THREADRESULT_H diff --git a/gui/translationhandler.h b/gui/translationhandler.h index 77749a8fa..29b7308e8 100644 --- a/gui/translationhandler.h +++ b/gui/translationhandler.h @@ -23,6 +23,10 @@ #include #include +/// @addtogroup GUI +/// @{ + + class TranslationHandler : QObject { Q_OBJECT @@ -41,5 +45,5 @@ protected: QTranslator *mTranslator; private: }; - +/// @} #endif // TRANSLATIONHANDLER_H diff --git a/gui/txtreport.h b/gui/txtreport.h index 27d6e7be1..1cf1cf6ef 100644 --- a/gui/txtreport.h +++ b/gui/txtreport.h @@ -26,6 +26,10 @@ #include #include "report.h" +/// @addtogroup GUI +/// @{ + + /** * @brief Text file report. * This report mimics the output of the command line cppcheck. @@ -66,5 +70,5 @@ private: */ QTextStream mTxtWriter; }; - +/// @} #endif // TXT_REPORT_H diff --git a/gui/xmlreport.h b/gui/xmlreport.h index f7885a12a..cf3f7f4b5 100644 --- a/gui/xmlreport.h +++ b/gui/xmlreport.h @@ -26,6 +26,10 @@ #include #include "report.h" +/// @addtogroup GUI +/// @{ + + /** * @brief XML file report. * This report outputs XML-formatted report. The XML format must match command @@ -66,5 +70,5 @@ private: */ QXmlStreamWriter mXmlWriter; }; - +/// @} #endif // XML_REPORT_H diff --git a/src/check.h b/src/check.h index 84233583e..c249aff0f 100644 --- a/src/check.h +++ b/src/check.h @@ -27,6 +27,9 @@ #include #include +/// @addtogroup Core +/// @{ + /** * @brief Interface class that cppcheck uses to communicate with the checks. * All checking classes must inherit from this class @@ -52,7 +55,7 @@ public: instances().remove(this); } - /** get instances of this */ + /** List of registered check classes. This is used by Cppcheck to run checks and generate documentation */ static std::list &instances() { static std::list _instances; @@ -69,10 +72,10 @@ public: /** get error messages */ virtual void getErrorMessages() = 0; - /** class name */ + /** class name, used to generate documentation */ virtual std::string name() const = 0; - /** get information about this class */ + /** get information about this class, used to generate documentation */ virtual std::string classInfo() const = 0; protected: @@ -119,7 +122,7 @@ protected: } private: - /** compare the names of Check classes */ + /** compare the names of Check classes, used when sorting the Check descendants */ bool operator<(const Check *other) const { return (name() < other->name()); @@ -127,7 +130,7 @@ private: }; - +/// @} #endif diff --git a/src/checkautovariables.h b/src/checkautovariables.h index 71bcec244..831d93bbf 100644 --- a/src/checkautovariables.h +++ b/src/checkautovariables.h @@ -26,6 +26,10 @@ #include "token.h" #include +/// @addtogroup Checks +/// @{ + + class CheckAutoVariables : public Check { public: @@ -84,7 +88,7 @@ private: " * assigning address of an variable to an effective parameter of a function\n"; } }; - +/// @} //--------------------------------------------------------------------------- #endif diff --git a/src/checkbufferoverrun.h b/src/checkbufferoverrun.h index eec97430d..7fe6a510c 100644 --- a/src/checkbufferoverrun.h +++ b/src/checkbufferoverrun.h @@ -30,6 +30,10 @@ class ErrorLogger; class Token; class Tokenizer; +/// @addtogroup Checks +/// @{ + + class CheckBufferOverrun : public Check { public: @@ -93,7 +97,7 @@ private: return "out of bounds checking"; } }; - +/// @} //--------------------------------------------------------------------------- #endif diff --git a/src/checkclass.h b/src/checkclass.h index 02d56a0e0..ad3f46a16 100644 --- a/src/checkclass.h +++ b/src/checkclass.h @@ -26,6 +26,10 @@ class Token; +/// @addtogroup Checks +/// @{ + + class CheckClass : public Check { public: @@ -137,6 +141,7 @@ private: " * Are there unused private functions\n"; } }; +/// @} //--------------------------------------------------------------------------- #endif diff --git a/src/checkdangerousfunctions.h b/src/checkdangerousfunctions.h index 1dbd820e8..6c5df3375 100644 --- a/src/checkdangerousfunctions.h +++ b/src/checkdangerousfunctions.h @@ -24,6 +24,9 @@ #include "check.h" +/// @addtogroup Checks +/// @{ + class CheckDangerousFunctions : public Check { public: @@ -75,7 +78,7 @@ private: " * scanf\n"; } }; - +/// @} //--------------------------------------------------------------------------- #endif diff --git a/src/checkheaders.h b/src/checkheaders.h index be8627046..6fa6ac250 100644 --- a/src/checkheaders.h +++ b/src/checkheaders.h @@ -25,6 +25,10 @@ #include "tokenize.h" #include "errorlogger.h" +/// @addtogroup Checks +/// @{ + + class CheckHeaders { public: @@ -42,7 +46,7 @@ private: return "Headers"; } }; - +/// @} //--------------------------------------------------------------------------- #endif diff --git a/src/checkmemoryleak.h b/src/checkmemoryleak.h index 3fe0f9811..d972a3ff1 100644 --- a/src/checkmemoryleak.h +++ b/src/checkmemoryleak.h @@ -23,12 +23,16 @@ #define checkmemoryleakH //--------------------------------------------------------------------------- +/// @addtogroup Checks +/// @{ + + /** * Check for memory leaks * * The checking is split up into two specialized classes. - * CheckMemoryLeakInFunction can detect when a function variable is allocated but not deallocated properly. - * CheckMemoryLeakInClass can detect when a class variable is allocated but not deallocated properly. + * - CheckMemoryLeakInFunction can detect when a function variable is allocated but not deallocated properly. + * - CheckMemoryLeakInClass can detect when a class variable is allocated but not deallocated properly. */ #include "check.h" @@ -39,15 +43,35 @@ class Token; -/** Base class for memory leaks checking */ - +/** @brief Base class for memory leaks checking */ class CheckMemoryLeak { private: const Tokenizer * const tokenizer; ErrorLogger * const errorLogger; - ErrorLogger::ErrorMessage errmsg(const Token *tok, Severity::e severity, const std::string &id, const std::string &msg) const; + /** Disable the default constructors */ + CheckMemoryLeak(); + + /** Disable the default constructors */ + CheckMemoryLeak(const CheckMemoryLeak &); + + /** + * Report error. Similar with the function Check::reportError + * @param location the token where the error occurs + * @param severity the severity of the bug + * @param id type of message + * @param msg text + */ + ErrorLogger::ErrorMessage errmsg(const Token *location, Severity::e severity, const std::string &id, const std::string &msg) const; + + /** + * Report error. Similar with the function Check::reportError + * @param callstack callstack of error + * @param severity the severity of the bug + * @param id type of message + * @param msg text + */ ErrorLogger::ErrorMessage errmsg(const std::list &callstack, Severity::e severity, const std::string &id, const std::string &msg) const; public: @@ -82,21 +106,23 @@ public: /** - * Check function variables. + * @brief CheckMemoryLeakInFunction detects when a function variable is allocated but not deallocated properly. * * The checking is done by looking at each function variable separately. By repeating these 4 steps over and over: - * 1. locate a function variable - * 2. create a simple token list that describes the usage of the function variable. - * 3. simplify the token list. - * 4. finally, check if the simplified token list contain any leaks. + * -# locate a function variable + * -# create a simple token list that describes the usage of the function variable. + * -# simplify the token list. + * -# finally, check if the simplified token list contain any leaks. */ -class CheckMemoryLeakInFunction : public Check, private CheckMemoryLeak +class CheckMemoryLeakInFunction : private Check, private CheckMemoryLeak { public: + /** This constructor is used when registering this class */ CheckMemoryLeakInFunction() : Check(), CheckMemoryLeak(0, 0) { } + /** This constructor is used when running checks */ CheckMemoryLeakInFunction(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger) { } @@ -107,9 +133,6 @@ public: checkMemoryLeak.check(); } -#ifndef UNIT_TESTING -private: -#endif void check(); private: @@ -125,27 +148,75 @@ private: */ bool notvar(const Token *tok, const char *varnames[], bool endpar = false); - + /** + * Inspect a function call. the call_func and getcode are recursive + * @param tok token where the function call occurs + * @param callstack callstack + * @param varnames the variable name that is currently checked + * @param alloctype if memory is allocated, this indicates the type of allocation + * @param dealloctype if memory is deallocated, this indicates the type of deallocation + * @param all is the code simplified according to the "--all" rules or not? + * @param sz not used by call_func - see getcode + * @return These are the possible return values: + * - NULL : no significant code + * - "recursive" : recursive function + * - "alloc" : the function returns allocated memory + * - "dealloc" : the function deallocates the variable + * - "dealloc_" + * - "use" : the variable is used (unknown usage of the variable => the checking bails out) + * - "callfunc" + * - "&use" + */ const char * call_func(const Token *tok, std::list callstack, const char *varnames[], AllocType &alloctype, AllocType &dealloctype, bool &all, unsigned int sz); /** - * Extract a new tokens list that is easier to parse than the "tokens" + * Extract a new tokens list that is easier to parse than the "_tokenizer->tokens()", the + * extracted tokens list describes how the given variable is used. + * The getcode and call_func are recursive * @param tok start parse token * @param callstack callstack * @param varname name of variable - * @param alloctype - * @param dealloctype + * @param alloctype keep track of what type of allocation is used + * @param dealloctype keeps track of what type of deallocation is used + * @param classmember should be set if the inspected function is a class member + * @param all has the getcode been simplified according to the "--all" rules? + * @param sz size of type, used to check for mismatching size of allocation. for example "int *a;" => the sz is "sizeof(int)" * @return Newly allocated token array. Caller needs to release reserved * memory by calling Tokenizer::deleteTokens(returnValue); + * Returned tokens: + * - alloc : the variable is allocated + * - dealloc : the variable is deallocated + * - realloc : the variable is reallocated + * - use : unknown usage -> bail out checking of this execution path + * - &use : the address of the variable is taken + * - ::use : calling member function of class + * - assign : the variable is assigned a new value + * - if : there is an "if" + * - if(var) : corresponds with "if ( var != 0 )" + * - if(!var) : corresponds with "if ( var == 0 )" + * - ifv : the variable is used in some way in a "if" + * - loop : corresponds to either a "for" or a "while" + * - continue : corresponds to "continue" + * - break : corresponds to "break" + * - goto : corresponds to a "goto" + * - return : corresponds to a "return" */ Token *getcode(const Token *tok, std::list callstack, const char varname[], AllocType &alloctype, AllocType &dealloctype, bool classmember, bool &all, unsigned int sz); /** * Simplify code e.g. by replacing empty "{ }" with ";" * @param tok first token. The tokens list can be modified. + * @param all is the code simplified according to the "--all" rules or not */ void simplifycode(Token *tok, bool &all); + /** + * Checking the variable varname + * @param Tok1 start token + * @param varname name of variable + * @param classmember is the scope inside a class member function + * @param sz size of type.. if the variable is a "int *" then sz should be "sizeof(int)" + */ void checkScope(const Token *Tok1, const char varname[], bool classmember, unsigned int sz); void getErrorMessages() @@ -165,11 +236,10 @@ private: /** - * Check class variables - * variables that are allocated in the constructor should be deallocated in the destructor + * @brief %Check class variables, variables that are allocated in the constructor should be deallocated in the destructor */ -class CheckMemoryLeakInClass : public Check, private CheckMemoryLeak +class CheckMemoryLeakInClass : private Check, private CheckMemoryLeak { public: CheckMemoryLeakInClass() : Check(), CheckMemoryLeak(0, 0) @@ -185,9 +255,6 @@ public: checkMemoryLeak.check(); } -#ifndef UNIT_TESTING -private: -#endif void check(); private: @@ -210,12 +277,9 @@ private: -/** - * Check class variables - * variables that are allocated in the constructor should be deallocated in the destructor - */ +/** @brief detect simple memory leaks for struct members */ -class CheckMemoryLeakStructMember : public Check, private CheckMemoryLeak +class CheckMemoryLeakStructMember : private Check, private CheckMemoryLeak { public: CheckMemoryLeakStructMember() : Check(), CheckMemoryLeak(0, 0) @@ -238,16 +302,6 @@ public: private: - void error(const Token *tok, const Severity::e severity, const std::string &id, const std::string &msg) - { - reportError(tok, severity, id, msg); - } - - void error(const std::list &callstack, const Severity::e severity, const std::string &id, const std::string &msg) - { - reportError(callstack, severity, id, msg); - } - void getErrorMessages() { } @@ -258,9 +312,9 @@ private: std::string classInfo() const { - return "Don't forget to free struct members"; + return "Don't forget to deallocate struct members"; } }; - +/// @} //--------------------------------------------------------------------------- #endif diff --git a/src/checkother.h b/src/checkother.h index 7fa2562d8..a684d3158 100644 --- a/src/checkother.h +++ b/src/checkother.h @@ -27,6 +27,9 @@ class Token; +/// @addtogroup Checks +/// @{ + class CheckOther : public Check { public: @@ -186,7 +189,7 @@ private: " * [[IncompleteStatement|Incomplete statement]]\n"; } }; - +/// @} //--------------------------------------------------------------------------- #endif diff --git a/src/checkstl.h b/src/checkstl.h index df7b36c7c..05b74932b 100644 --- a/src/checkstl.h +++ b/src/checkstl.h @@ -26,6 +26,10 @@ class Token; +/// @addtogroup Checks +/// @{ + + /** @brief %Check STL usage */ class CheckStl : public Check { @@ -123,7 +127,7 @@ private: " * for vectors: using iterator/pointer after push_back has been used\n"; } }; - +/// @} //--------------------------------------------------------------------------- #endif diff --git a/src/checkunusedfunctions.h b/src/checkunusedfunctions.h index 3eeb6ce38..442f8c53a 100644 --- a/src/checkunusedfunctions.h +++ b/src/checkunusedfunctions.h @@ -25,6 +25,9 @@ #include "tokenize.h" #include "errorlogger.h" +/// @addtogroup Checks +/// @{ + class CheckUnusedFunctions { public: @@ -63,7 +66,7 @@ private: std::map _functions; }; - +/// @} //--------------------------------------------------------------------------- #endif diff --git a/src/cppcheck.h b/src/cppcheck.h index 1a1967ac7..c782c2f30 100644 --- a/src/cppcheck.h +++ b/src/cppcheck.h @@ -28,6 +28,9 @@ #include "errorlogger.h" #include "checkunusedfunctions.h" +/// @addtogroup Core +/// @{ + /** * This is the base class which will use other classes to do * static code analysis for C and C++ code to find possible @@ -144,4 +147,6 @@ private: std::list _xmllist; }; +/// @} + #endif // CPPCHECK_H diff --git a/src/errorlogger.h b/src/errorlogger.h index ee299005f..adbc8646d 100644 --- a/src/errorlogger.h +++ b/src/errorlogger.h @@ -26,6 +26,9 @@ class Token; class Tokenizer; +/// @addtogroup Core +/// @{ + /** * This is an interface, which the class responsible of error logging * should implement. @@ -358,4 +361,6 @@ public: }; +/// @} + #endif diff --git a/src/filelister.h b/src/filelister.h index 1463f9c04..f659fa376 100644 --- a/src/filelister.h +++ b/src/filelister.h @@ -22,6 +22,10 @@ #include #include +/// @addtogroup Core +/// @{ + + // Check that the compiler are supported // This program should be compiled with either GCC/BORLAND/MSC to work.. #ifndef __GNUC__ @@ -46,4 +50,6 @@ private: }; +/// @} + #endif // #ifndef FILELISTER_H diff --git a/src/mathlib.h b/src/mathlib.h index 706381d3a..948452c4f 100644 --- a/src/mathlib.h +++ b/src/mathlib.h @@ -22,6 +22,10 @@ #include "token.h" +/// @addtogroup Core +/// @{ + + class MathLib { public: @@ -44,4 +48,6 @@ public: static bool isGreater(const std::string & first, const std::string & second); }; +/// @} + #endif diff --git a/src/preprocessor.h b/src/preprocessor.h index 122284e66..c129dff7b 100644 --- a/src/preprocessor.h +++ b/src/preprocessor.h @@ -27,6 +27,9 @@ #include #include "errorlogger.h" +/// @addtogroup Core +/// @{ + /** @brief The cppcheck preprocessor. It has special functionality for extracting the various ifdef configurations that exist in a source file. */ class Preprocessor { @@ -141,6 +144,8 @@ private: }; +/// @} + //--------------------------------------------------------------------------- #endif diff --git a/src/settings.h b/src/settings.h index 6d67c5acd..41a3f235d 100644 --- a/src/settings.h +++ b/src/settings.h @@ -23,6 +23,10 @@ #include #include +/// @addtogroup Core +/// @{ + + /** * This is just a container for general settings so that we don't need * to pass individual values to functions or constructors now or in the @@ -75,4 +79,6 @@ public: bool isAutoDealloc(const char classname[]) const; }; +/// @} + #endif // SETTINGS_H diff --git a/src/token.h b/src/token.h index 26bded969..6ff4a3999 100644 --- a/src/token.h +++ b/src/token.h @@ -21,6 +21,9 @@ #include +/// @addtogroup Core +/// @{ + /** * @brief The token list that the Tokenizer generates is a linked-list of this class. * @@ -226,4 +229,6 @@ private: unsigned int _linenr; }; +/// @} + #endif // TokenH diff --git a/src/tokenize.h b/src/tokenize.h index 1e77536d9..a4758bf21 100644 --- a/src/tokenize.h +++ b/src/tokenize.h @@ -30,10 +30,14 @@ class Token; class ErrorLogger; class Settings; +/// @addtogroup Core +/// @{ + +/** @brief The main purpose is to tokenize the source code. It also has functions that simplify the token list */ class Tokenizer { private: - // Deallocate lists.. + /** Deallocate lists.. */ void deallocateTokens(); public: @@ -280,5 +284,7 @@ private: ErrorLogger * const _errorLogger; }; +/// @} + //--------------------------------------------------------------------------- #endif