From 4ef8a85b4cac02fc903983047e31903431afbae7 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:06:40 +0000 Subject: Utilisateur : Fcolin Date : 10/02/04 Heure : 17:06 Créé Commentaire: (vss 1) --- IvyAudioMon/ParseCmdLine.cpp | 76 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 IvyAudioMon/ParseCmdLine.cpp (limited to 'IvyAudioMon/ParseCmdLine.cpp') diff --git a/IvyAudioMon/ParseCmdLine.cpp b/IvyAudioMon/ParseCmdLine.cpp new file mode 100644 index 0000000..fc6a1d8 --- /dev/null +++ b/IvyAudioMon/ParseCmdLine.cpp @@ -0,0 +1,76 @@ +// ParseCmdLine.cpp: implementation of the ParseCmdLine class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" + +#include "ParseCmdLine.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +ParseCmdLine::ParseCmdLine() +{ + m_start = TRUE; + m_busNumber = ""; + m_prefix = "IvyFileMon "; + m_directory = "c:\\anoto_log\\strokes"; + m_extent = "*.txt"; +} + +ParseCmdLine::~ParseCmdLine() +{ + +} + +void ParseCmdLine::ParseParam(LPCTSTR lpszParam, BOOL bFlag, BOOL bLast) +{ + if (bFlag) + { + ParseParamFlag(lpszParam); + } + else + ParseParamNotFlag(lpszParam); + +} + +void ParseCmdLine::ParseParamFlag(LPCTSTR pszParam) +{ + + if (lstrcmpi(pszParam, TEXT("start")) == 0) + m_start = TRUE; + else if (lstrcmpi(pszParam, TEXT("bus")) == 0) + m_shellCommand = BusNumber; + else if (lstrcmpi(pszParam, TEXT("directory")) == 0) + m_shellCommand = Directory; + else if (lstrcmpi(pszParam, TEXT("prefix")) == 0) + m_shellCommand = Prefix; + else if (lstrcmpi(pszParam, TEXT("extent")) == 0) + m_shellCommand = Extent; +} + +void ParseCmdLine::ParseParamNotFlag(LPCTSTR pszParam) +{ + switch ( m_shellCommand ) + { + case BusNumber: + m_busNumber = pszParam; + break; + case Directory: + m_directory = pszParam; + break; + case Prefix: + m_prefix = pszParam; + break; + case Extent: + m_extent = pszParam; + break; + } +} -- cgit v1.1 From 4f558e7603406f501857a590355e51d8e43b2361 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:06:41 +0000 Subject: Utilisateur : Fcolin Date : 28/09/04 Heure : 15:06 Archivé dans $/Bus/IvyAudioMon Commentaire: (vss 2) --- IvyAudioMon/ParseCmdLine.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'IvyAudioMon/ParseCmdLine.cpp') diff --git a/IvyAudioMon/ParseCmdLine.cpp b/IvyAudioMon/ParseCmdLine.cpp index fc6a1d8..59a27ce 100644 --- a/IvyAudioMon/ParseCmdLine.cpp +++ b/IvyAudioMon/ParseCmdLine.cpp @@ -20,8 +20,8 @@ ParseCmdLine::ParseCmdLine() { m_start = TRUE; m_busNumber = ""; - m_prefix = "IvyFileMon "; - m_directory = "c:\\anoto_log\\strokes"; + m_prefix = "IvyAudioMon "; + m_seuil = 15.0; m_extent = "*.txt"; } @@ -48,8 +48,8 @@ void ParseCmdLine::ParseParamFlag(LPCTSTR pszParam) m_start = TRUE; else if (lstrcmpi(pszParam, TEXT("bus")) == 0) m_shellCommand = BusNumber; - else if (lstrcmpi(pszParam, TEXT("directory")) == 0) - m_shellCommand = Directory; + else if (lstrcmpi(pszParam, TEXT("seuil")) == 0) + m_shellCommand = Seuil; else if (lstrcmpi(pszParam, TEXT("prefix")) == 0) m_shellCommand = Prefix; else if (lstrcmpi(pszParam, TEXT("extent")) == 0) @@ -63,8 +63,8 @@ void ParseCmdLine::ParseParamNotFlag(LPCTSTR pszParam) case BusNumber: m_busNumber = pszParam; break; - case Directory: - m_directory = pszParam; + case Seuil: + m_seuil = atof(pszParam); break; case Prefix: m_prefix = pszParam; -- cgit v1.1