summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfcolin2007-02-15 14:28:12 +0000
committerfcolin2007-02-15 14:28:12 +0000
commit9d8c527211edd2bc74fa548f30f69f8d21868fef (patch)
tree01c03a0c7700ed5fce9b63771f1dbfe8bebaf1b3
parent9faf3708bd1188de84ccf33c400bfdceefc7fd1b (diff)
downloadivy-csharp-9d8c527211edd2bc74fa548f30f69f8d21868fef.zip
ivy-csharp-9d8c527211edd2bc74fa548f30f69f8d21868fef.tar.gz
ivy-csharp-9d8c527211edd2bc74fa548f30f69f8d21868fef.tar.bz2
ivy-csharp-9d8c527211edd2bc74fa548f30f69f8d21868fef.tar.xz
Parsing des argument ligne de commandes
-rw-r--r--getopt/Arg.cs15
-rw-r--r--getopt/GetOpt.cs98
-rw-r--r--getopt/bin/Debug/getopt.dllbin0 -> 16384 bytes
-rw-r--r--getopt/bin/Debug/getopt.pdbbin0 -> 13824 bytes
-rw-r--r--getopt/bin/Release/getopt.dllbin0 -> 16384 bytes
-rw-r--r--getopt/getopt.csproj106
-rw-r--r--getopt/getopt.csproj.user58
-rw-r--r--getopt/getopt.csproj.vspscc10
-rw-r--r--getopt/getopt.sln19
-rw-r--r--getopt/getopt.suobin0 -> 14336 bytes
-rw-r--r--getopt/mssccprj.scc5
-rw-r--r--getopt/obj/Debug/Refactor/getopt.dllbin0 -> 16384 bytes
-rw-r--r--getopt/obj/Debug/getopt.dllbin0 -> 16384 bytes
-rw-r--r--getopt/obj/Debug/getopt.pdbbin0 -> 13824 bytes
-rw-r--r--getopt/obj/Release/getopt.dllbin0 -> 16384 bytes
-rw-r--r--getopt/obj/getopt.csproj.FileList.txt8
-rw-r--r--getopt/vssver2.sccbin0 -> 164 bytes
17 files changed, 319 insertions, 0 deletions
diff --git a/getopt/Arg.cs b/getopt/Arg.cs
new file mode 100644
index 0000000..0b86cad
--- /dev/null
+++ b/getopt/Arg.cs
@@ -0,0 +1,15 @@
+using System;
+
+namespace Gnu
+{
+ /// <summary>
+ /// An argument for GetOpt
+ /// </summary>
+ public class Arg
+ {
+ public char Flag;
+ public bool TakesParameter = false;
+
+ public string Parameter = "";
+ }
+}
diff --git a/getopt/GetOpt.cs b/getopt/GetOpt.cs
new file mode 100644
index 0000000..a158073
--- /dev/null
+++ b/getopt/GetOpt.cs
@@ -0,0 +1,98 @@
+using System;
+using System.Collections.Specialized;
+using System.Collections.Generic;
+
+namespace Gnu
+{
+ /// <summary>
+ /// An implementation of the getopt standard, as used by Gnu GetOpt
+ /// </summary>
+ public class GetOpt
+ {
+ StringCollection m_params = new StringCollection();
+ StringCollection m_extras = new StringCollection();
+ List<Arg> m_args = new List<Arg>();
+
+ public GetOpt(string[] CommandLineArgs, string ParametersDescription)
+ {
+ // Import the string array into the collection
+ foreach(string s in CommandLineArgs)
+ {
+ m_params.Add(s);
+ }
+
+ // Parse the params description
+ for(int i = 0; i < ParametersDescription.Length; i++)
+ {
+ Arg a = new Arg();
+ a.Flag = ParametersDescription[i];
+ if((ParametersDescription.Length > i + 1) && (ParametersDescription[i + 1] == ':'))
+ {
+ a.TakesParameter = true;
+ i++;
+ }
+
+ m_args.Add(a);
+ }
+ }
+
+ public Arg NextArg()
+ {
+ SnarfExtras();
+
+ if(m_params.Count == 0)
+ return null;
+
+ foreach(Arg a in m_args)
+ {
+ if(a.Flag == m_params[0][1] && m_params[0][0] == '-' )
+ {
+ Arg matched = a;
+ try
+ {
+ if(a.TakesParameter)
+ {
+ matched.Parameter = m_params[1];
+ m_params.RemoveAt(1);
+ }
+ }
+ catch(Exception)
+ {
+ }
+
+ m_params.RemoveAt(0);
+ return matched;
+ }
+ }
+
+ if(m_params[0][0] == '-')
+ {
+ Arg tempa = new Arg();
+ tempa.Flag = m_params[0][1];
+ tempa.TakesParameter = false;
+ return tempa;
+ }
+ return null;
+ }
+
+ public StringCollection Extras
+ {
+ get
+ {
+ SnarfExtras();
+
+ return m_extras;
+ }
+ }
+
+ private void SnarfExtras()
+ {
+ // Parameters must start with a hyphen
+ while((m_params.Count > 0) && (m_params[0][0] != '-'))
+ {
+ m_extras.Add(m_params[0]);
+ m_params.RemoveAt(0);
+ }
+ }
+ }
+}
diff --git a/getopt/bin/Debug/getopt.dll b/getopt/bin/Debug/getopt.dll
new file mode 100644
index 0000000..d928e54
--- /dev/null
+++ b/getopt/bin/Debug/getopt.dll
Binary files differ
diff --git a/getopt/bin/Debug/getopt.pdb b/getopt/bin/Debug/getopt.pdb
new file mode 100644
index 0000000..7b5eb2b
--- /dev/null
+++ b/getopt/bin/Debug/getopt.pdb
Binary files differ
diff --git a/getopt/bin/Release/getopt.dll b/getopt/bin/Release/getopt.dll
new file mode 100644
index 0000000..2dfdc9d
--- /dev/null
+++ b/getopt/bin/Release/getopt.dll
Binary files differ
diff --git a/getopt/getopt.csproj b/getopt/getopt.csproj
new file mode 100644
index 0000000..3cca427
--- /dev/null
+++ b/getopt/getopt.csproj
@@ -0,0 +1,106 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{228B5F0B-31AE-488F-A916-B7CBB269D25F}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ApplicationIcon>
+ </ApplicationIcon>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
+ <AssemblyName>getopt</AssemblyName>
+ <AssemblyOriginatorKeyFile>
+ </AssemblyOriginatorKeyFile>
+ <DefaultClientScript>JScript</DefaultClientScript>
+ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+ <DefaultTargetSchema>IE50</DefaultTargetSchema>
+ <DelaySign>false</DelaySign>
+ <OutputType>Library</OutputType>
+ <RootNamespace>getopt</RootNamespace>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <StartupObject>
+ </StartupObject>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <SccProjectName>SAK</SccProjectName>
+ <SccLocalPath>SAK</SccLocalPath>
+ <SccAuxPath>SAK</SccAuxPath>
+ <SccProvider>SAK</SccProvider>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoStdLib>false</NoStdLib>
+ <NoWarn>
+ </NoWarn>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>bin\Release\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>TRACE</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>false</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoStdLib>false</NoStdLib>
+ <NoWarn>
+ </NoWarn>
+ <Optimize>true</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>none</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System">
+ <Name>System</Name>
+ </Reference>
+ <Reference Include="System.Data">
+ <Name>System.Data</Name>
+ </Reference>
+ <Reference Include="System.XML">
+ <Name>System.XML</Name>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Arg.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="GetOpt.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PreBuildEvent>
+ </PreBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+</Project> \ No newline at end of file
diff --git a/getopt/getopt.csproj.user b/getopt/getopt.csproj.user
new file mode 100644
index 0000000..cfcf828
--- /dev/null
+++ b/getopt/getopt.csproj.user
@@ -0,0 +1,58 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <LastOpenVersion>7.10.3077</LastOpenVersion>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ReferencePath>
+ </ReferencePath>
+ <CopyProjectDestinationFolder>
+ </CopyProjectDestinationFolder>
+ <CopyProjectUncPath>
+ </CopyProjectUncPath>
+ <CopyProjectOption>0</CopyProjectOption>
+ <ProjectView>ProjectFiles</ProjectView>
+ <ProjectTrust>0</ProjectTrust>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <EnableASPDebugging>false</EnableASPDebugging>
+ <EnableASPXDebugging>false</EnableASPXDebugging>
+ <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
+ <EnableSQLServerDebugging>false</EnableSQLServerDebugging>
+ <RemoteDebugEnabled>false</RemoteDebugEnabled>
+ <RemoteDebugMachine>
+ </RemoteDebugMachine>
+ <StartAction>Project</StartAction>
+ <StartArguments>
+ </StartArguments>
+ <StartPage>
+ </StartPage>
+ <StartProgram>
+ </StartProgram>
+ <StartURL>
+ </StartURL>
+ <StartWorkingDirectory>
+ </StartWorkingDirectory>
+ <StartWithIE>true</StartWithIE>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <EnableASPDebugging>false</EnableASPDebugging>
+ <EnableASPXDebugging>false</EnableASPXDebugging>
+ <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
+ <EnableSQLServerDebugging>false</EnableSQLServerDebugging>
+ <RemoteDebugEnabled>false</RemoteDebugEnabled>
+ <RemoteDebugMachine>
+ </RemoteDebugMachine>
+ <StartAction>Project</StartAction>
+ <StartArguments>
+ </StartArguments>
+ <StartPage>
+ </StartPage>
+ <StartProgram>
+ </StartProgram>
+ <StartURL>
+ </StartURL>
+ <StartWorkingDirectory>
+ </StartWorkingDirectory>
+ <StartWithIE>false</StartWithIE>
+ </PropertyGroup>
+</Project> \ No newline at end of file
diff --git a/getopt/getopt.csproj.vspscc b/getopt/getopt.csproj.vspscc
new file mode 100644
index 0000000..feffdec
--- /dev/null
+++ b/getopt/getopt.csproj.vspscc
@@ -0,0 +1,10 @@
+""
+{
+"FILE_VERSION" = "9237"
+"ENLISTMENT_CHOICE" = "NEVER"
+"PROJECT_FILE_RELATIVE_PATH" = ""
+"NUMBER_OF_EXCLUDED_FILES" = "0"
+"ORIGINAL_PROJECT_FILE_PATH" = ""
+"NUMBER_OF_NESTED_PROJECTS" = "0"
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
+}
diff --git a/getopt/getopt.sln b/getopt/getopt.sln
new file mode 100644
index 0000000..3dab7ec
--- /dev/null
+++ b/getopt/getopt.sln
@@ -0,0 +1,19 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "getopt", "getopt.csproj", "{228B5F0B-31AE-488F-A916-B7CBB269D25F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {228B5F0B-31AE-488F-A916-B7CBB269D25F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {228B5F0B-31AE-488F-A916-B7CBB269D25F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {228B5F0B-31AE-488F-A916-B7CBB269D25F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {228B5F0B-31AE-488F-A916-B7CBB269D25F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/getopt/getopt.suo b/getopt/getopt.suo
new file mode 100644
index 0000000..fc0301d
--- /dev/null
+++ b/getopt/getopt.suo
Binary files differ
diff --git a/getopt/mssccprj.scc b/getopt/mssccprj.scc
new file mode 100644
index 0000000..2aeb91c
--- /dev/null
+++ b/getopt/mssccprj.scc
@@ -0,0 +1,5 @@
+SCC = This is a Source Code Control file
+
+[getopt.csproj]
+SCC_Aux_Path = "C:\Users\fcolin\Documents\Visual Source Safe"
+SCC_Project_Name = "$/CSharp/getopt", RBIAAAAA
diff --git a/getopt/obj/Debug/Refactor/getopt.dll b/getopt/obj/Debug/Refactor/getopt.dll
new file mode 100644
index 0000000..41e8a7f
--- /dev/null
+++ b/getopt/obj/Debug/Refactor/getopt.dll
Binary files differ
diff --git a/getopt/obj/Debug/getopt.dll b/getopt/obj/Debug/getopt.dll
new file mode 100644
index 0000000..d928e54
--- /dev/null
+++ b/getopt/obj/Debug/getopt.dll
Binary files differ
diff --git a/getopt/obj/Debug/getopt.pdb b/getopt/obj/Debug/getopt.pdb
new file mode 100644
index 0000000..7b5eb2b
--- /dev/null
+++ b/getopt/obj/Debug/getopt.pdb
Binary files differ
diff --git a/getopt/obj/Release/getopt.dll b/getopt/obj/Release/getopt.dll
new file mode 100644
index 0000000..2dfdc9d
--- /dev/null
+++ b/getopt/obj/Release/getopt.dll
Binary files differ
diff --git a/getopt/obj/getopt.csproj.FileList.txt b/getopt/obj/getopt.csproj.FileList.txt
new file mode 100644
index 0000000..875bb18
--- /dev/null
+++ b/getopt/obj/getopt.csproj.FileList.txt
@@ -0,0 +1,8 @@
+bin\Debug\getopt.dll
+bin\Debug\getopt.pdb
+obj\Debug\ResolveAssemblyReference.cache
+obj\Debug\getopt.dll
+obj\Debug\getopt.pdb
+bin\Release\getopt.dll
+obj\Release\ResolveAssemblyReference.cache
+obj\Release\getopt.dll
diff --git a/getopt/vssver2.scc b/getopt/vssver2.scc
new file mode 100644
index 0000000..44d6a95
--- /dev/null
+++ b/getopt/vssver2.scc
Binary files differ