⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ccommandline.h

📁 PGP8.0源码 请认真阅读您的文件包然后写出其具体功能
💻 H
字号:
/*____________________________________________________________________________
		Copyright (C) 2002 PGP Corporation
        All rights reserved.

        $Id: CCommandLine.h,v 1.2 2002/08/06 20:09:30 dallen Exp $
____________________________________________________________________________*/

#ifndef Included_CCommandLine_h	// [
#define Included_CCommandLine_h

#include "CArray.h"
#include "CList.h"
#include "CString.h"

_PGP_BEGIN

// Types

class CParameter;

// Class CCommandLine

class CCommandLine
{
public:
	struct Rule
	{
		const char	*command;
		const char	*validOptions;
		PGPUInt32	minArgs;
		PGPUInt32	maxArgs;
	};

public:
	CCommandLine();
	CCommandLine(const char *cmdLine, Rule *pRules, PGPUInt32 numRules);
	~CCommandLine();

	void	AllowCatchAll(PGPBoolean allow, Rule& catchAllRule);

	PGPBoolean	Parse(const char *& command, CArray<char>& options, 
		PGPUInt32& numOptions, CArray<const char *>& args, 
		PGPUInt32& numArgs);

	void	Init(const char *cmdLine, Rule *pRules, PGPUInt32 numRules);
	void	Clear();

private:
	CList<CParameter>	mParams;
	CParameter			*mPCurParam;
	
	CArray<Rule>	mRules;
	PGPUInt32		mNumRules;

	PGPBoolean	mAllowCatchAll;
	Rule		mCatchAllRule;
};

_PGP_END

#endif	// Included_CCommandLine_h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -