diff options
author | fcolin | 2007-02-01 13:12:27 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 13:12:27 +0000 |
commit | 501bc7c837b0d6d77d7e5d073020ac20fbd1c02a (patch) | |
tree | a49a98443e4a36735c90af46e5f77543584f32d8 | |
parent | 67833fd79a7908d81d92e95c5de19884d5f3ab8c (diff) | |
download | ivy-cplusplus-501bc7c837b0d6d77d7e5d073020ac20fbd1c02a.zip ivy-cplusplus-501bc7c837b0d6d77d7e5d073020ac20fbd1c02a.tar.gz ivy-cplusplus-501bc7c837b0d6d77d7e5d073020ac20fbd1c02a.tar.bz2 ivy-cplusplus-501bc7c837b0d6d77d7e5d073020ac20fbd1c02a.tar.xz |
Utilisateur : Fcolin Date : 31/01/01 Heure : 15:50 Créé (vss 1)
-rw-r--r-- | IvyProbe/TestParseCmdLine.cpp | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/IvyProbe/TestParseCmdLine.cpp b/IvyProbe/TestParseCmdLine.cpp new file mode 100644 index 0000000..6b9201e --- /dev/null +++ b/IvyProbe/TestParseCmdLine.cpp @@ -0,0 +1,75 @@ +// FxParseCmdLine.cpp: implementation of the FxParseCmdLine class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "NewFxServer.h"
+#include "FxParseCmdLine.h"
+
+#ifdef _DEBUG
+#undef THIS_FILE
+static char THIS_FILE[]=__FILE__;
+#define new DEBUG_NEW
+#endif
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+FxParseCmdLine::FxParseCmdLine()
+{
+ m_loop = FALSE;
+ m_start = FALSE;
+ m_busstart = FALSE;
+ m_speed = 10000;
+ m_exoFile = "D:\\users\\fcolin\\DATA\\SceTobago.toc";
+ m_busNumber = "";
+}
+
+FxParseCmdLine::~FxParseCmdLine()
+{
+
+}
+
+void FxParseCmdLine::ParseParam(LPCTSTR lpszParam, BOOL bFlag, BOOL bLast)
+{
+ if (bFlag)
+ {
+ ParseParamFlag(lpszParam);
+ }
+ else
+ ParseParamNotFlag(lpszParam);
+
+}
+
+void FxParseCmdLine::ParseParamFlag(LPCTSTR pszParam)
+{
+ if (lstrcmpi(pszParam, "loop") == 0)
+ m_loop = TRUE;
+ else if (lstrcmpi(pszParam, "busstart") == 0)
+ m_busstart = TRUE;
+ else if (lstrcmpi(pszParam, "start") == 0)
+ m_start = TRUE;
+ else if (lstrcmpi(pszParam, "bus") == 0)
+ m_shellCommand = BusNumber;
+ else if (lstrcmpi(pszParam, "file") == 0)
+ m_shellCommand = ExoFile;
+ else if (lstrcmpi(pszParam, "speed") == 0)
+ m_shellCommand = Speed;
+}
+
+void FxParseCmdLine::ParseParamNotFlag(LPCTSTR pszParam)
+{
+ switch ( m_shellCommand )
+ {
+ case BusNumber:
+ m_busNumber = pszParam;
+ break;
+ case ExoFile:
+ m_exoFile = pszParam;
+ break;
+ case Speed:
+ m_speed = atoi(pszParam);
+ break;
+ }
+}
|