argumentparser.h

来自「ReactOS是一些高手根据Windows XP的内核编写出的类XP。内核实现机」· C头文件 代码 · 共 43 行

H
43
字号
/* $Id: ArgumentParser.h 15091 2005-05-07 21:24:31Z sedwards $ */

// ArgumentParser.h: interface for the CArgumentParser class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(ARGUMENTPARSER_H__D4C1F637_BEBF_11D3_91EE_204C4F4F5020__INCLUDED_)
#define ARGUMENTPARSER_H__D4C1F637_BEBF_11D3_91EE_204C4F4F5020__INCLUDED_

// Use this class to create parser of command line object
class CArgumentParser
{
public:
	// Call this function to specify buffer containing the command line to be parsed
	// Parameters:
	//	pchArguments - pointer to buffer containing the command line. This buffer is modified by object,
	//					and must not be accessed extrenaly when object is used, unless you interate it
	//					only once and modify only substrings returned by GetNextArgument.
	//
	// Remarks:
	// This object can be reused by setting the buffer multiple times.
	void SetArgumentList(TCHAR *pchArguments);

	// Call this function to reset argument iteration. You don't need to call this function after call
	// to set SetArgumentList, because calling SetArgumentList resets iteration with new buffer.
	void ResetArgumentIteration();

	// Call this function to get next argument from command line.
	//
	// Returns:
	//	Function returns next argument. If this is first call after calling SetArgumentList or
	//	ResetArgumentIteration, functions returns the first argument (The command itself ?).
	TCHAR * GetNextArgument();
	CArgumentParser();
	virtual ~CArgumentParser();
private:
	TCHAR *m_pchArgumentList;		// points to begin of argumet list
	const TCHAR *m_pchArgumentListEnd;	// points to last 0 in argument list
	TCHAR *m_pchArgument;
};

#endif // !defined(ARGUMENTPARSER_H__D4C1F637_BEBF_11D3_91EE_204C4F4F5020__INCLUDED_)

⌨️ 快捷键说明

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