From 501bc7c837b0d6d77d7e5d073020ac20fbd1c02a Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:12:27 +0000 Subject: Utilisateur : Fcolin Date : 31/01/01 Heure : 15:50 Créé (vss 1) --- IvyProbe/TestParseCmdLine.cpp | 75 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 IvyProbe/TestParseCmdLine.cpp (limited to 'IvyProbe') 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; + } +} -- cgit v1.1