diff options
author | fcolin | 2007-02-01 13:06:40 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 13:06:40 +0000 |
commit | c5683980eb7b0fe47f4dda86b34c28e665769ce9 (patch) | |
tree | a83d5eff43b62a0eb0003c45466b3906777550d7 /Bus/IvyAudioMon | |
parent | 38e92c6ca389d44261a1d5a31aac0a86d826e532 (diff) | |
download | ivy-cplusplus-c5683980eb7b0fe47f4dda86b34c28e665769ce9.zip ivy-cplusplus-c5683980eb7b0fe47f4dda86b34c28e665769ce9.tar.gz ivy-cplusplus-c5683980eb7b0fe47f4dda86b34c28e665769ce9.tar.bz2 ivy-cplusplus-c5683980eb7b0fe47f4dda86b34c28e665769ce9.tar.xz |
Utilisateur : Fcolin Date : 10/02/04 Heure : 17:06 Créé Commentaire: (vss 1)
Diffstat (limited to 'Bus/IvyAudioMon')
-rw-r--r-- | Bus/IvyAudioMon/ParseCmdLine.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/Bus/IvyAudioMon/ParseCmdLine.cpp b/Bus/IvyAudioMon/ParseCmdLine.cpp new file mode 100644 index 0000000..fc6a1d8 --- /dev/null +++ b/Bus/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;
+ }
+}
|