mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
581 B
46 lines
581 B
#include "stdafx.h"
|
|
#include "cmd.h"
|
|
|
|
CCmd::CCmd()
|
|
{
|
|
m_argc = 0;
|
|
m_argv = NULL;
|
|
}
|
|
|
|
CCmd::~CCmd()
|
|
{
|
|
}
|
|
|
|
CCmd::bInit(int argc, LPSTR argv[])
|
|
{
|
|
m_argc = argc;
|
|
m_argv = argv;
|
|
|
|
return ParseCmdLine();
|
|
}
|
|
|
|
BOOL CCmd::ParseCmdLine()
|
|
{
|
|
int argc;
|
|
LPTSTR *argv;
|
|
|
|
argc = m_argc;
|
|
argv = m_argv;
|
|
|
|
if (argc > 1) {
|
|
argc--;
|
|
argv++;
|
|
} else {
|
|
return FALSE;
|
|
}
|
|
|
|
while(argc) {
|
|
if (ProcessToken(*argv)) {
|
|
argc--;
|
|
argv++;
|
|
} else {
|
|
return FALSE;
|
|
}
|
|
}
|
|
return TRUE;
|
|
}
|