diff options
Diffstat (limited to 'IvyProbe/TestParseCmdLine.cpp')
-rw-r--r-- | IvyProbe/TestParseCmdLine.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/IvyProbe/TestParseCmdLine.cpp b/IvyProbe/TestParseCmdLine.cpp new file mode 100644 index 0000000..62eff43 --- /dev/null +++ b/IvyProbe/TestParseCmdLine.cpp @@ -0,0 +1,58 @@ +// TestParseCmdLine.cpp: implementation of the TestParseCmdLine class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+
+#include "TestParseCmdLine.h"
+
+#ifdef _DEBUG
+#undef THIS_FILE
+static char THIS_FILE[]=__FILE__;
+#define new DEBUG_NEW
+#endif
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+TestParseCmdLine::TestParseCmdLine()
+{
+ m_start = FALSE;
+ m_busNumber = "";
+}
+
+TestParseCmdLine::~TestParseCmdLine()
+{
+
+}
+
+void TestParseCmdLine::ParseParam(LPCTSTR lpszParam, BOOL bFlag, BOOL bLast)
+{
+ if (bFlag)
+ {
+ ParseParamFlag(lpszParam);
+ }
+ else
+ ParseParamNotFlag(lpszParam);
+
+}
+
+void TestParseCmdLine::ParseParamFlag(LPCTSTR pszParam)
+{
+
+ if (lstrcmpi(pszParam, TEXT("start")) == 0)
+ m_start = TRUE;
+ else if (lstrcmpi(pszParam, TEXT("bus")) == 0)
+ m_shellCommand = BusNumber;
+}
+
+void TestParseCmdLine::ParseParamNotFlag(LPCTSTR pszParam)
+{
+ switch ( m_shellCommand )
+ {
+ case BusNumber:
+ m_busNumber = pszParam;
+ break;
+ }
+}
|