41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
/***************************************************************************
|
|
Argument Parser Class Header ( ArgParser.h )
|
|
-----------------------------------------
|
|
|
|
begin : 2013/05/28
|
|
copyright : (C) 2013 Solbox Inc.
|
|
author : Development 1 Team
|
|
- 2013/05/28 - 1st dadamin
|
|
email : dev1@solbox.com
|
|
version : 3.2.0
|
|
|
|
CopyRight(C) 2005 Solbox Inc. All Rights reserved.
|
|
Redistribution and use in source and binary forms, with or with out
|
|
modification, are not permitted in outside of Solbox Inc.
|
|
***************************************************************************/
|
|
#ifndef __ARGUMENT_PARSER_H__
|
|
#define __ARGUMENT_PARSER_H__
|
|
|
|
class CArgParser
|
|
{
|
|
public:
|
|
CArgParser(int argc, char** argv);
|
|
~CArgParser();
|
|
|
|
bool argparseflag(vector<char*>::iterator &i, ...);
|
|
bool argparsewitharg(vector<char*>::iterator &i, string *ret, ...);
|
|
|
|
bool checkvalue(const char *c, string *ret = NULL);
|
|
|
|
inline bool empty() { return m_args.empty(); }
|
|
|
|
protected:
|
|
void dashes2underscores(const char *input, char *output);
|
|
bool parsewitharg(vector<char*>::iterator &i, std::string *ret, va_list ap);
|
|
|
|
private:
|
|
vector<char*> m_args;
|
|
};
|
|
|
|
#endif // __ARGUMENT_PARSER_H__
|