summaryrefslogtreecommitdiffstats
path: root/CCommandLine.h
blob: 0d4817d6bd6ffccd379a539d1bf9ffdb4edab9a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
	This file is a part of "Didrole's Update Tool"
	©2k12, Didrole
	
	License : Public domain
*/

#pragma once

class CCommandLine
{
public:
	CCommandLine(int argc, char **argv);
	~CCommandLine();

	const char* ParmValues(const char *psz, unsigned int ix) const;
	const char* ParmValue(const char *psz, const char *pDefaultVal = 0) const;
	int ParmValue(const char *psz, int nDefaultVal) const;

	unsigned int ParmCount() const;
	unsigned int FindParmCount(const char *psz) const;
	unsigned int FindParm(const char *psz, unsigned int ix = 0) const;
	const char* GetParm(unsigned int nIndex) const;

	void AddParm(const char *psz);

private:

	static const unsigned int k_nMaxArgs = 64;

	int m_argc;
	char *m_argv[k_nMaxArgs];
};