CMUtil/inc/hgl/util/cmd/CmdParse.h

30 lines
985 B
C
Raw Normal View History

2019-11-29 11:58:31 +08:00
#ifndef HGL_COMMAND_LINE_PARSE_INCLUDE
#define HGL_COMMAND_LINE_PARSE_INCLUDE
#include<hgl/type/StringList.h>
namespace hgl
{
namespace util
{
/**
*
*/
class CmdParse ///命令行参数解晰辅助类
{
OSStringList args;
public:
CmdParse(const OSStringList &);
2019-12-02 11:01:54 +08:00
CmdParse(const int,os_char **);
virtual ~CmdParse()=default;
2019-11-29 11:58:31 +08:00
int Find(const OSString &)const; ///<查找一个指定字串开头的参数是否存在
bool GetInteger(const OSString &,int *)const; ///<取得一个数值参数
bool GetString(const OSString &,OSString &)const; ///<取得一个字符串参数
};//class CmdParse
}//namespace util
}//namespace hgl
#endif//HGL_COMMAND_LINE_PARSE_INCLUDE