Add some comments for the CmdLineParser class.
Also remove one unneeded forward declaration.
This commit is contained in:
parent
5d539c76fe
commit
a7ee5a0488
|
@ -22,28 +22,65 @@
|
|||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
class CppCheck;
|
||||
class Settings;
|
||||
|
||||
/// @addtogroup CLI
|
||||
/// @{
|
||||
|
||||
/**
|
||||
* @brief The command line parser.
|
||||
* The command line parser parses options and parameters user gives to
|
||||
* cppcheck command line.
|
||||
*
|
||||
* The parser takes a pointer to Settings instance which it will update
|
||||
* based on options user has given. Couple of options are handled as
|
||||
* class internal options.
|
||||
*/
|
||||
class CmdLineParser
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* The constructor.
|
||||
* @param settings Settings instance that will be modified accoding to
|
||||
* options user has given.
|
||||
*/
|
||||
CmdLineParser(Settings *settings);
|
||||
|
||||
/**
|
||||
* Parse given command line.
|
||||
* @return true if command line was ok, false if there was an error.
|
||||
*/
|
||||
bool ParseFromArgs(int argc, const char* const argv[]);
|
||||
|
||||
/**
|
||||
* Return if user wanted to see program version.
|
||||
*/
|
||||
bool GetShowVersion() const
|
||||
{
|
||||
return _showVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if user wanted to see list of error messages.
|
||||
*/
|
||||
bool GetShowErrorMessages() const
|
||||
{
|
||||
return _showErrorMessages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the path names user gave to command line.
|
||||
*/
|
||||
std::vector<std::string> GetPathNames() const
|
||||
{
|
||||
return _pathnames;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Print help text to the console.
|
||||
*/
|
||||
void PrintHelp();
|
||||
|
||||
private:
|
||||
|
@ -54,4 +91,6 @@ private:
|
|||
std::vector<std::string> _pathnames;
|
||||
};
|
||||
|
||||
/// @}
|
||||
|
||||
#endif // CMDLINE_PARSER_H
|
||||
|
|
Loading…
Reference in New Issue