Registry Explorer (console tool) by Nedko Arnaoudov added to the system utilities...
[reactos.git] / rosapps / sysutils / regexpl / ArgumentParser.h
1 // ArgumentParser.h: interface for the CArgumentParser class.
2 //
3 //////////////////////////////////////////////////////////////////////
4
5 #if !defined(ARGUMENTPARSER_H__D4C1F637_BEBF_11D3_91EE_204C4F4F5020__INCLUDED_)
6 #define ARGUMENTPARSER_H__D4C1F637_BEBF_11D3_91EE_204C4F4F5020__INCLUDED_
7
8 // Use this class to create parser of command line object
9 class CArgumentParser
10 {
11 public:
12 // Call this function to specify buffer containing the command line to be parsed
13 // Parameters:
14 // pchArguments - pointer to buffer containing the command line. This buffer is modified by object,
15 // and must not be accessed extrenaly when object is used, unless you interate it
16 // only once and modify only substrings returned by GetNextArgument.
17 //
18 // Remarks:
19 // This object can be reused by setting the buffer multiple times.
20 void SetArgumentList(TCHAR *pchArguments);
21
22 // Call this function to reset argument iteration. You don't need to call this function after call
23 // to set SetArgumentList, because calling SetArgumentList resets iteration with new buffer.
24 void ResetArgumentIteration();
25
26 // Call this function to get next argument from command line.
27 //
28 // Returns:
29 // Function returns next argument. If this is first call after calling SetArgumentList or
30 // ResetArgumentIteration, functions returns the first argument (The command itself ?).
31 TCHAR * GetNextArgument();
32 CArgumentParser();
33 virtual ~CArgumentParser();
34 private:
35 TCHAR *m_pchArgumentList; // points to begin of argumet list
36 const TCHAR *m_pchArgumentListEnd; // points to last 0 in argument list
37 TCHAR *m_pchArgument;
38 };
39
40 #endif // !defined(ARGUMENTPARSER_H__D4C1F637_BEBF_11D3_91EE_204C4F4F5020__INCLUDED_)