From ee7603b7ba3e487608b91bdeb6f8674899e6ed3f Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 12:52:34 +0000 Subject: Utilisateur : Fcolin Date : 25/10/01 Heure : 11:44 Créé (vss 1) --- Horloge/HorlogeParseCmdLine.cpp | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Horloge/HorlogeParseCmdLine.cpp (limited to 'Horloge') diff --git a/Horloge/HorlogeParseCmdLine.cpp b/Horloge/HorlogeParseCmdLine.cpp new file mode 100644 index 0000000..bd3e4e9 --- /dev/null +++ b/Horloge/HorlogeParseCmdLine.cpp @@ -0,0 +1,58 @@ +// HorlogeParseCmdLine.cpp: implementation of the HorlogeParseCmdLine class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" + +#include "HorlogeParseCmdLine.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +HorlogeParseCmdLine::HorlogeParseCmdLine() +{ + m_start = FALSE; + m_busNumber = ""; +} + +HorlogeParseCmdLine::~HorlogeParseCmdLine() +{ + +} + +void HorlogeParseCmdLine::ParseParam(LPCTSTR lpszParam, BOOL bFlag, BOOL bLast) +{ + if (bFlag) + { + ParseParamFlag(lpszParam); + } + else + ParseParamNotFlag(lpszParam); + +} + +void HorlogeParseCmdLine::ParseParamFlag(LPCTSTR pszParam) +{ + + if (lstrcmpi(pszParam, TEXT("start")) == 0) + m_start = TRUE; + else if (lstrcmpi(pszParam, TEXT("bus")) == 0) + m_shellCommand = BusNumber; +} + +void HorlogeParseCmdLine::ParseParamNotFlag(LPCTSTR pszParam) +{ + switch ( m_shellCommand ) + { + case BusNumber: + m_busNumber = pszParam; + break; + } +} -- cgit v1.1