1 Star 0 Fork 10

zhaoyao/supervisor

forked from leo/supervisor 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
command.h 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
leo 提交于 2016-12-12 17:29 . First edition
#ifndef __COMMAND_H_INCLUDED__
#define __COMMAND_H_INCLUDED__
#include <map>
#include <string>
class Command {
public:
Command() {}
Command(int nArgc, char * pArgv[]) { Parse(nArgc, pArgv); }
Command(const std::string & sCmd) { Parse(sCmd); }
/**
* Parse command line parameters.
*
* \param nArgc Number of params pasted from main.
* \param pArgv Parameter list.
**/
void Parse(int nArgc, char * pArgv[]);
/**
* Parse white-space splited command list.
*
* \param sCmd White-space splited command like "-std=c++11 -lpthread"
**/
void Parse(const std::string & sCmd);
/**
* Check if there exists a command named after gaven key.
*
* \param sKey Key for this command. '-std' is a key in '-std=c++11'.
* \return True for exiting.
**/
bool Has(const std::string & sKey);
/**
* Get value of some parameter.
*
* \param sKey Key for this parameter. '-std' is a key in '-std=c++11'.
* \return Value of this parameter. 'c++11' is value of '-std=c++11'.
**/
std::string Get(const std::string & sKey);
private:
std::map<std::string, std::string> _mCmd;
};
#endif//! __COMMAND_H_INCLUDED__
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/zhaoyao219/supervisor.git
[email protected]:zhaoyao219/supervisor.git
zhaoyao219
supervisor
supervisor
master

搜索帮助