Fix build_init vcxproj to correctly detect changes in config.h.
target_mach=yes
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP"
libmono_cflags="-D_THREAD_SAFE"
+
+ # avoid AR calling ranlib, libtool calls it anyway. suppress no symbols warning.
+ AR_FLAGS="Scru"
+ RANLIB="ranlib -no_warning_for_no_symbols"
+
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID)
AC_DEFINE(USE_MACH_SEMA, 1, [...])
AOT_SUPPORTED="yes"
BTLS_SUPPORTED=yes
BTLS_PLATFORM=i386
+ AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
;;
darwin*)
AOT_SUPPORTED="yes"
AOT_SUPPORTED="yes"
BTLS_SUPPORTED=yes
BTLS_PLATFORM=x86_64
+ AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
;;
darwin*)
AOT_SUPPORTED="yes"
mono_runtime=mono/mini/mono
AC_SUBST(mono_runtime)
-CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.1.3.2/tools/csc.exe
+CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.0.0/tools/csc.exe
if test $csc_compiler = mcs; then
CSC=$mcs_topdir/class/lib/build/mcs.exe
-Subproject commit 670081afaf2a5662ec6471a7e2603c7ca6e8edbc
+Subproject commit 690603bea98aae69fca9a65130d88591bc6cabee
-Subproject commit a1c06d559d6f2cbbaeae86ea87632d409a82ca94
+Subproject commit 606eb25118347c5c8eeb69d247fcfe4ecb43460c
if (!Version.TryParse (field.GetValue (null) as string, out version))
return 4;
- if (version < new Version (4, 8))
+ if (version < new Version (4, 9))
return 5;
return 0;
# make dist will collect files in .sources files from all profiles
dist-local: dist-default
subs=' ' ; \
- for f in `$(topdir)/tools/removecomments.sh $(wildcard *$(LIBRARY).sources)` $(TEST_FILES) ; do \
+ for f in `$(topdir)/tools/removecomments.sh $(filter-out $(wildcard *_test.dll.sources) $(wildcard *exclude.sources),$(wildcard *.sources))` $(TEST_FILES) ; do \
case $$f in \
../*) : ;; \
*.g.cs) : ;; \
<DelaySign>true</DelaySign>\r
</PropertyGroup>\r
<PropertyGroup>\r
- <AssemblyOriginatorKeyFile>../../msfinal.pub</AssemblyOriginatorKeyFile>\r
+ <AssemblyOriginatorKeyFile>../../Open.snk</AssemblyOriginatorKeyFile>\r
</PropertyGroup>\r
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
<DebugSymbols>true</DebugSymbols>\r
cp -p $< $@
lib/$(monolite_dir)/mcs.exe:
- $(MAKE) -C ../mcs PROFILE=basic
- cp -p lib/basic/mcs.exe lib/$(monolite_dir)
+ $(MAKE) -C ../mcs PROFILE=build
+ cp -p lib/build/mcs.exe lib/$(monolite_dir)
$(build_files:%=lib/build/%):
cd $(topdir) && $(MAKE) profile-do--build--all NO_DIR_CHECK=1 SKIP_AOT=1
commandLine.AppendSwitch ("/delaysign-");
if (Bag ["EmitDebugInformation"] != null)
if (EmitDebugInformation)
- commandLine.AppendSwitch ("/debug+");
+ commandLine.AppendSwitch ("/debug:portable");
else
commandLine.AppendSwitch ("/debug-");
//fileAlignment
mc.ARFC (c1);
mc.ACLC (c2);
- Assert.AreEqual ("/debug+", c1.ToString (), "A1");
+ Assert.AreEqual ("/debug:portable", c1.ToString (), "A1");
Assert.AreEqual (String.Empty, c2.ToString (), "A2");
}
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<ItemGroup>\r
<Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\Locale.cs" />\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
+ <Compile Include="..\System\Mono.Util\MonoPInvokeCallbackAttribute.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
<Compile Include="Mono.Data.Sqlite_2.0\LINQ\SQLiteConnection_Linq.cs" />\r
<Compile Include="Mono.Data.Sqlite_2.0\LINQ\SQLiteFactory_Linq.cs" />\r
- <Compile Include="Mono.Data.Sqlite_2.0\MonoPInvokeCallbackAttribute.cs" />\r
<Compile Include="Mono.Data.Sqlite_2.0\SQLite3.cs" />\r
<Compile Include="Mono.Data.Sqlite_2.0\SQLite3_UTF16.cs" />\r
<Compile Include="Mono.Data.Sqlite_2.0\SQLiteBase.cs" />\r
Assembly/AssemblyInfo.cs
../../build/common/Consts.cs
-../../build/common/Locale.cs
-../../build/common/MonoTODOAttribute.cs
-Mono.Data.Sqlite_2.0/MonoPInvokeCallbackAttribute.cs
+../System/Mono.Util/MonoPInvokeCallbackAttribute.cs
Mono.Data.Sqlite_2.0/SQLite3.cs
Mono.Data.Sqlite_2.0/SQLite3_UTF16.cs
Mono.Data.Sqlite_2.0/SQLiteBase.cs
+++ /dev/null
-//
-// MonoPInvokeCallbackAttribute.cs: necessary for AOT ports of Mono
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if MONOTOUCH
-
-using System;
-
-namespace MonoTouch {
-
- [AttributeUsage (AttributeTargets.Method)]
- sealed class MonoPInvokeCallbackAttribute : Attribute {
- public MonoPInvokeCallbackAttribute (Type t) {}
- }
-}
-
-#endif
}\r
\r
#if MONOTOUCH\r
- [MonoTouch.MonoPInvokeCallback(typeof(SQLiteCallback))]\r
+ [Mono.Util.MonoPInvokeCallback(typeof(SQLiteCallback))]\r
internal static void scalar_callback(IntPtr context, int nArgs, IntPtr argsptr)\r
{\r
var handle = GCHandle.FromIntPtr (UnsafeNativeMethods.sqlite3_user_data(context));\r
func.Func(context, nArgs, argsptr);\r
}\r
\r
- [MonoTouch.MonoPInvokeCallback(typeof(SQLiteCallback))]\r
+ [Mono.Util.MonoPInvokeCallback(typeof(SQLiteCallback))]\r
internal static void step_callback(IntPtr context, int nArgs, IntPtr argsptr)\r
{\r
var handle = GCHandle.FromIntPtr(UnsafeNativeMethods.sqlite3_user_data(context));\r
func.FuncStep(context, nArgs, argsptr);\r
}\r
\r
- [MonoTouch.MonoPInvokeCallback(typeof(SQLiteFinalCallback))]\r
+ [Mono.Util.MonoPInvokeCallback(typeof(SQLiteFinalCallback))]\r
internal static void final_callback(IntPtr context)\r
{\r
var handle = GCHandle.FromIntPtr(UnsafeNativeMethods.sqlite3_user_data(context));\r
func.FuncFinal(context);\r
}\r
\r
- [MonoTouch.MonoPInvokeCallback(typeof(SQLiteFinalCallback))]\r
+ [Mono.Util.MonoPInvokeCallback(typeof(SQLiteFinalCallback))]\r
internal static void destroy_callback(IntPtr context)\r
{\r
GCHandle.FromIntPtr(context).Free();\r
SQLiteCommitCallback commit_callback;\r
SQLiteRollbackCallback rollback_callback;\r
\r
- [MonoTouch.MonoPInvokeCallback (typeof (SQLiteUpdateCallback))]\r
+ [Mono.Util.MonoPInvokeCallback (typeof (SQLiteUpdateCallback))]\r
static void update (IntPtr puser, int type, IntPtr database, IntPtr table, Int64 rowid)\r
{\r
SQLite3 instance = GCHandle.FromIntPtr (puser).Target as SQLite3;\r
UnsafeNativeMethods.sqlite3_update_hook (_sql, update, GCHandle.ToIntPtr (gch));\r
}\r
\r
- [MonoTouch.MonoPInvokeCallback (typeof (SQLiteCommitCallback))]\r
+ [Mono.Util.MonoPInvokeCallback (typeof (SQLiteCommitCallback))]\r
static int commit (IntPtr puser)\r
{\r
SQLite3 instance = GCHandle.FromIntPtr (puser).Target as SQLite3;\r
UnsafeNativeMethods.sqlite3_commit_hook (_sql, commit, GCHandle.ToIntPtr (gch));\r
}\r
\r
- [MonoTouch.MonoPInvokeCallback (typeof (SQLiteRollbackCallback))]\r
+ [Mono.Util.MonoPInvokeCallback (typeof (SQLiteRollbackCallback))]\r
static void rollback (IntPtr puser)\r
{\r
SQLite3 instance = GCHandle.FromIntPtr (puser).Target as SQLite3;\r
return GetSchemaTable(true, false);\r
}\r
\r
- static bool hasColumnMetadataSupport = true;
-
+ static bool hasColumnMetadataSupport = true;\r
+\r
internal DataTable GetSchemaTable(bool wantUniqueInfo, bool wantDefaultValue)\r
{\r
CheckClosed();\r
DataTable tblIndexes = null;\r
DataTable tblIndexColumns;\r
DataRow row;\r
+#if !MONOTOUCH\r
string temp;\r
+#endif\r
string strCatalog = "";\r
string strTable = "";\r
string strColumn = "";\r
row[SchemaTableColumn.DataType] = GetFieldType(n);\r
row[SchemaTableOptionalColumn.IsHidden] = false;\r
\r
- // HACK: Prevent exploding if Sqlite was built without the SQLITE_ENABLE_COLUMN_METADATA option.
- //
- // This code depends on sqlite3_column_origin_name, which only exists if Sqlite was built with
- // the SQLITE_ENABLE_COLUMN_METADATA option. This is not the case on iOS, MacOS or (most?)
- // Androids, so we exclude it from the MONOTOUCH build, and degrade on other systems by simply
- // omitting the metadata from the result.
- //
- // TODO: we could implement better fallbacks as proposed in
- // https://bugzilla.xamarin.com/show_bug.cgi?id=2128
- //
-#if !MONOTOUCH
- if (hasColumnMetadataSupport) {
- try {
- strColumn = _command.Connection._sql.ColumnOriginalName(_activeStatement, n);
- if (String.IsNullOrEmpty(strColumn) == false) row[SchemaTableColumn.BaseColumnName] = strColumn;
-
- row[SchemaTableColumn.IsExpression] = String.IsNullOrEmpty(strColumn);
- row[SchemaTableColumn.IsAliased] = (String.Compare(GetName(n), strColumn, true, CultureInfo.InvariantCulture) != 0);
-
- temp = _command.Connection._sql.ColumnTableName(_activeStatement, n);
- if (String.IsNullOrEmpty(temp) == false) row[SchemaTableColumn.BaseTableName] = temp;
-
- temp = _command.Connection._sql.ColumnDatabaseName(_activeStatement, n);
- if (String.IsNullOrEmpty(temp) == false) row[SchemaTableOptionalColumn.BaseCatalogName] = temp;
- } catch (EntryPointNotFoundException) {
- hasColumnMetadataSupport = false;
- }
- }
+ // HACK: Prevent exploding if Sqlite was built without the SQLITE_ENABLE_COLUMN_METADATA option.\r
+ //\r
+ // This code depends on sqlite3_column_origin_name, which only exists if Sqlite was built with\r
+ // the SQLITE_ENABLE_COLUMN_METADATA option. This is not the case on iOS, MacOS or (most?)\r
+ // Androids, so we exclude it from the MONOTOUCH build, and degrade on other systems by simply\r
+ // omitting the metadata from the result.\r
+ //\r
+ // TODO: we could implement better fallbacks as proposed in\r
+ // https://bugzilla.xamarin.com/show_bug.cgi?id=2128\r
+ //\r
+#if !MONOTOUCH\r
+ if (hasColumnMetadataSupport) {\r
+ try {\r
+ strColumn = _command.Connection._sql.ColumnOriginalName(_activeStatement, n);\r
+ if (String.IsNullOrEmpty(strColumn) == false) row[SchemaTableColumn.BaseColumnName] = strColumn;\r
+\r
+ row[SchemaTableColumn.IsExpression] = String.IsNullOrEmpty(strColumn);\r
+ row[SchemaTableColumn.IsAliased] = (String.Compare(GetName(n), strColumn, true, CultureInfo.InvariantCulture) != 0);\r
+\r
+ temp = _command.Connection._sql.ColumnTableName(_activeStatement, n);\r
+ if (String.IsNullOrEmpty(temp) == false) row[SchemaTableColumn.BaseTableName] = temp;\r
+\r
+ temp = _command.Connection._sql.ColumnDatabaseName(_activeStatement, n);\r
+ if (String.IsNullOrEmpty(temp) == false) row[SchemaTableOptionalColumn.BaseCatalogName] = temp;\r
+ } catch (EntryPointNotFoundException) {\r
+ hasColumnMetadataSupport = false;\r
+ }\r
+ }\r
#endif\r
\r
string dataType = null;\r
}\r
\r
#if MONOTOUCH\r
- [MonoTouch.MonoPInvokeCallback (typeof (SQLiteCollation))]\r
+ [Mono.Util.MonoPInvokeCallback (typeof (SQLiteCollation))]\r
internal static int collation_callback (IntPtr puser, int len1, IntPtr pv1, int len2, IntPtr pv2)\r
{\r
var handle = GCHandle.FromIntPtr (puser);\r
return func._CompareFunc (IntPtr.Zero, len1, pv1, len2, pv2);\r
}\r
\r
- [MonoTouch.MonoPInvokeCallback (typeof (SQLiteCollation))]\r
+ [Mono.Util.MonoPInvokeCallback (typeof (SQLiteCollation))]\r
internal static int collation_callback16 (IntPtr puser, int len1, IntPtr pv1, int len2, IntPtr pv2)\r
{\r
var handle = GCHandle.FromIntPtr (puser);\r
public static void ss6_2 () {
}
- [MethodImplAttribute (MethodImplOptions.NoInlining)]
- public static void ss7 () {
- try {
- ss7_2 ();
- ss7_3 ();
- } catch {
- }
- ss7_2 ();
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
+ public static void ss7 ()
+ {
+ ss7_2();//Used to test stepout inside ss7_2, which may not go to catch
+ ss7_2();//Used to test stepout inside ss7_2_1, which must go to catch
+ ss7_2();//Used to test stepover inside ss7_2, which must go to catch
+ ss7_2();//Used to test stepover inside ss7_2_1, which must go to catch
+ ss7_3();//Used to test stepin inside ss7_3, which must go to catch
+ ss7_2();//Used to test stepin inside ss7_2_1, which must go to catch
}
- [MethodImplAttribute (MethodImplOptions.NoInlining)]
- public static void ss7_2 () {
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
+ public static void ss7_2_1 ()
+ {
+ throw new Exception ();
}
- [MethodImplAttribute (MethodImplOptions.NoInlining)]
- public static void ss7_3 () {
- throw new Exception ();
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
+ public static void ss7_2_2 ()
+ {
+ ss7_2_1();
+ }
+
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
+ public static void ss7_2 ()
+ {
+ try {
+ ss7_2_2();
+ }
+ catch
+ {
+ }
+ }
+
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
+ public static void ss7_3 ()
+ {
+ try {
+ throw new Exception ();
+ }
+ catch
+ {
+ }
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
}
[Test]
- [Category ("NotWorking")] // https://bugzilla.xamarin.com/show_bug.cgi?id=44974
public void SingleStepping () {
Event e = run_until ("single_stepping");
assert_location (e, "ss6");
req.Disable ();
- // Check that a step over stops at an EH clause
+ // Testing stepping in, over and out with exception handlers in same or caller method
+
+ //stepout in ss7_2, which may not go to catch(instead out to ss7)
e = run_until ("ss7_2");
- req = create_step (e);
- req.Depth = StepDepth.Out;
- req.Enable ();
- e = step_once ();
- assert_location (e, "ss7");
- req.Disable ();
- req = create_step (e);
- req.Depth = StepDepth.Over;
- req.Enable ();
- e = step_once ();
- assert_location (e, "ss7");
- req.Disable ();
+ create_step (e);
+ assert_location (step_out(), "ss7");
+
+ //stepout in ss7_2_1, which must go to catch
+ run_until ("ss7_2_1");
+ assert_location (step_out (), "ss7_2");
+
+ //stepover over ss7_2, which must go to catch
+ run_until ("ss7_2");
+ assert_location (step_over (), "ss7_2");//move to "try {" line
+ assert_location (step_over (), "ss7_2");//move to "ss7_2_2();" line
+ assert_location (step_over (), "ss7_2");//step over ss7_2_2();, assume we are at "catch" now
+ assert_location (step_over (), "ss7_2");//move to { of catch
+ assert_location (step_over (), "ss7_2");//move to } of catch
+ assert_location (step_over (), "ss7_2");//move to } of method
+ assert_location (step_over (), "ss7");//finish method
+
+ //stepover over ss7_2_1, which must go to catch
+ run_until ("ss7_2_1");
+ assert_location (step_over (), "ss7_2_1");//move from { of method to "throw new Exception ();"
+ assert_location (step_over (), "ss7_2");//step over exception, being in ss7_2 means we are at catch
+
+ //stepin in ss7_3, which must go to catch
+ run_until ("ss7_3");
+ assert_location (step_into (), "ss7_3");//move to "try {"
+ assert_location (step_into (), "ss7_3");//move to "throw new Exception ();"
+ step_req.Disable ();
+ step_req.AssemblyFilter = new AssemblyMirror [] { (e as BreakpointEvent).Method.DeclaringType.Assembly };
+ assert_location (step_into (), "ss7_3");//call "throw new Exception ();", we assume we end up at "catch"
+ assert_location (step_into (), "ss7_3");//move to { of catch
+ assert_location (step_into (), "ss7_3");//move to } of catch
+ assert_location (step_into (), "ss7_3");//move to } of method
+ assert_location (step_into (), "ss7");//move out to ss7
+
+ //stepover in ss7_2_1, which must go to catch
+ run_until ("ss7_2_1");
+ assert_location (step_into (), "ss7_2_1");//move from { of method to "throw new Exception ();"
+ assert_location (step_into (), "ss7_2");//step in exception, being in ss7_2 means we are at catch
+ step_req.Disable ();
// Check that stepping stops between nested calls
e = run_until ("ss_nested_2");
+ req = create_step (e);
e = step_out ();
assert_location (e, "ss_nested");
e = step_into ();
e = step_over ();
assert_location (e, "ss_nested");
e = step_into ();
+ assert_location (e, "ss_nested_2");
+ e = step_into ();
+ assert_location (e, "ss_nested_2");
+ e = step_into ();
+ assert_location (e, "ss_nested_2");
+ e = step_into ();
+ assert_location (e, "ss_nested");
+ e = step_into ();
assert_location (e, "ss_nested_1");
e = step_into ();
assert_location (e, "ss_nested_1");
req.Size = StepSize.Line;
e = step_out ();
+ e = step_over ();//Stepout gets us to ss_recursive2_trap ();, move to ss_recursive2 (next); line
assert_location (e, "ss_recursive2");
// Stack should consist of Main + single_stepping + (1 ss_recursive2 frame per loop iteration)
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MONOTOUCH && !XAMMAC
+
using System;
using System.Globalization;
using System.Security.Cryptography;
}
}
}
+
+#endif
\ No newline at end of file
+++ /dev/null
-./Assembly/AssemblyInfo.cs
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-./Mono.Math/BigInteger.cs
-./Mono.Math.Prime/ConfidenceFactor.cs
-./Mono.Math.Prime/PrimalityTests.cs
-./Mono.Math.Prime.Generator/NextPrimeFinder.cs
-./Mono.Math.Prime.Generator/PrimeGeneratorBase.cs
-./Mono.Math.Prime.Generator/SequentialSearchPrimeGeneratorBase.cs
-./Mono.Security/ASN1.cs
-./Mono.Security/ASN1Convert.cs
-./Mono.Security/BitConverterLE.cs
-./Mono.Security/PKCS7.cs
-./Mono.Security/StrongName.cs
-./Mono.Security.Authenticode/AuthenticodeBase.cs
-./Mono.Security.Authenticode/AuthenticodeDeformatter.cs
-./Mono.Security.Authenticode/AuthenticodeFormatter.cs
-./Mono.Security.Authenticode/SoftwarePublisherCertificate.cs
-./Mono.Security.Authenticode/PrivateKey.cs
-./Mono.Security.Cryptography/CryptoConvert.cs
-./Mono.Security.Cryptography/CryptoTools.cs
-./Mono.Security.Cryptography/DHKeyGeneration.cs
-./Mono.Security.Cryptography/DHParameters.cs
-./Mono.Security.Cryptography/DiffieHellman.cs
-./Mono.Security.Cryptography/DiffieHellmanManaged.cs
-./Mono.Security.Cryptography/KeyPairPersistence.cs
-./Mono.Security.Cryptography/MD2.cs
-./Mono.Security.Cryptography/MD4.cs
-./Mono.Security.Cryptography/PKCS1.cs
-./Mono.Security.Cryptography/PKCS8.cs
-./Mono.Security.Cryptography/RC4.cs
-./Mono.Security.Cryptography/RSAManaged.cs
-./Mono.Security.Cryptography/SHA224.cs
-./Mono.Security.Cryptography/SymmetricTransform.cs
-./Mono.Security.X509/PKCS12.cs
-./Mono.Security.X509/X501Name.cs
-./Mono.Security.X509/X509Builder.cs
-./Mono.Security.X509/X509Certificate.cs
-./Mono.Security.X509/X509CertificateCollection.cs
-./Mono.Security.X509/X509CertificateBuilder.cs
-./Mono.Security.X509/X509Chain.cs
-./Mono.Security.X509/X509ChainStatusFlags.cs
-./Mono.Security.X509/X509CRL.cs
-./Mono.Security.X509/X509Extension.cs
-./Mono.Security.X509/X509Extensions.cs
-./Mono.Security.X509/X509Store.cs
-./Mono.Security.X509/X509StoreManager.cs
-./Mono.Security.X509/X509Stores.cs
-./Mono.Security.X509/X520Attributes.cs
-./Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
-./Mono.Security.X509.Extensions/BasicConstraintsExtension.cs
-./Mono.Security.X509.Extensions/CRLDistributionPointsExtension.cs
-./Mono.Security.X509.Extensions/CertificatePoliciesExtension.cs
-./Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
-./Mono.Security.X509.Extensions/GeneralNames.cs
-./Mono.Security.X509.Extensions/KeyAttributesExtension.cs
-./Mono.Security.X509.Extensions/KeyUsageExtension.cs
-./Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
-./Mono.Security.X509.Extensions/PrivateKeyUsagePeriodExtension.cs
-./Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
-./Mono.Security.X509.Extensions/SubjectKeyIdentifierExtension.cs
-./Mono.Security.Cryptography/TlsHMAC.cs
-./Mono.Security.Cryptography/MD5SHA1.cs
-./Mono.Security.Protocol.Tls/Alert.cs
-./Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
-./Mono.Security.Protocol.Tls/CipherSuite.cs
-./Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
-./Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
-./Mono.Security.Protocol.Tls/ClientContext.cs
-./Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
-./Mono.Security.Protocol.Tls/ClientSessionCache.cs
-./Mono.Security.Protocol.Tls/ContentType.cs
-./Mono.Security.Protocol.Tls/Context.cs
-./Mono.Security.Protocol.Tls/DebugHelper.cs
-./Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
-./Mono.Security.Protocol.Tls/HandshakeState.cs
-./Mono.Security.Protocol.Tls/HashAlgorithmType.cs
-./Mono.Security.Protocol.Tls/HttpsClientStream.cs
-./Mono.Security.Protocol.Tls/RecordProtocol.cs
-./Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
-./Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
-./Mono.Security.Protocol.Tls/SecurityCompressionType.cs
-./Mono.Security.Protocol.Tls/SecurityParameters.cs
-./Mono.Security.Protocol.Tls/SecurityProtocolType.cs
-./Mono.Security.Protocol.Tls/ServerContext.cs
-./Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
-./Mono.Security.Protocol.Tls/SslClientStream.cs
-./Mono.Security.Protocol.Tls/SslCipherSuite.cs
-./Mono.Security.Protocol.Tls/SslHandshakeHash.cs
-./Mono.Security.Protocol.Tls/SslServerStream.cs
-./Mono.Security.Protocol.Tls/SslStreamBase.cs
-./Mono.Security.Protocol.Tls/TlsCipherSuite.cs
-./Mono.Security.Protocol.Tls/TlsClientSettings.cs
-./Mono.Security.Protocol.Tls/TlsException.cs
-./Mono.Security.Protocol.Tls/TlsServerSettings.cs
-./Mono.Security.Protocol.Tls/TlsStream.cs
-./Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
-./Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
-./Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
-./Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
-./Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
-./Mono.Xml/MiniParser.cs
-./Mono.Xml/SecurityParser.cs
-
-./Mono.Security.Interface/BufferOffsetSize.cs
-./Mono.Security.Interface/SecretParameters.cs
-./Mono.Security.Interface/SecureBuffer.cs
-./Mono.Security.Interface/TlsBuffer.cs
-./Mono.Security.Interface/TlsMultiBuffer.cs
+++ /dev/null
-#include mobile_Mono.Security.dll.sources
-./Mono.Security.Cryptography/ARC4Managed.cs
-./Mono.Security.Cryptography/MD2Managed.cs
-./Mono.Security.Cryptography/MD4Managed.cs
-./Mono.Security.Cryptography/SHA224Managed.cs
-#include mobile_Mono.Security.dll.sources
+#include Mono.Security.dll.sources
../corlib/CommonCrypto/CommonCrypto.cs
../corlib/CommonCrypto/RC4CommonCrypto.cs
+Mono.Security.Interface/MonoTlsProviderFactory.Apple.cs
--- /dev/null
+#include monotouch_Mono.Security.dll.sources
--- /dev/null
+#include monotouch_Mono.Security.dll.sources
+++ /dev/null
-#include monotouch_Mono.Security.dll.sources
+++ /dev/null
-#include mobile_Mono.Security.dll.sources
-./Mono.Security.Cryptography/ARC4Managed.cs
-./Mono.Security.Cryptography/MD2Managed.cs
-./Mono.Security.Cryptography/MD4Managed.cs
-./Mono.Security.Cryptography/SHA224Managed.cs
+++ /dev/null
-#include mobile_Mono.Security.dll.sources
-./Mono.Security.Cryptography/ARC4Managed.cs
-./Mono.Security.Cryptography/MD2Managed.cs
-./Mono.Security.Cryptography/MD4Managed.cs
-./Mono.Security.Cryptography/SHA224Managed.cs
+++ /dev/null
-#include mobile_Mono.Security.dll.sources
-./Mono.Security.Cryptography/ARC4Managed.cs
-./Mono.Security.Cryptography/MD2Managed.cs
-./Mono.Security.Cryptography/MD4Managed.cs
-./Mono.Security.Cryptography/SHA224Managed.cs
#include monotouch_Mono.Security.dll.sources
-../corlib/CommonCrypto/CommonCrypto.cs
-../corlib/CommonCrypto/RC4CommonCrypto.cs
-
include ../../build/library.make
TEST_HARNESS_EXCLUDES += $(extra_test_flags)
-
-ifneq ($(PROFILE),basic)
-csproj-local:
- $(MAKE) csproj-local
-endif
<SchemaVersion>2.0</SchemaVersion>\r
<ProjectGuid>{359142A1-D80F-401E-AA64-7167C9317649}</ProjectGuid>\r
<OutputType>Library</OutputType>\r
- <NoWarn>1699,436,1720</NoWarn>\r
+ <NoWarn>1699,436</NoWarn>\r
<OutputPath>./../../class/lib/net_4_x</OutputPath>\r
<IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
<DebugSymbols>true</DebugSymbols>\r
<DebugType>full</DebugType>\r
- <NoWarn>1699,436,1720</NoWarn>\r
+ <NoWarn>1699,436</NoWarn>\r
<Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT</DefineConstants>\r
+ <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_COMPILE;FEATURE_COMPILE_TO_METHODBUILDER;FEATURE_PDB_GENERATOR</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
<DebugType>pdbonly</DebugType>\r
- <NoWarn>1699,436,1720</NoWarn>\r
+ <NoWarn>1699,436</NoWarn>\r
<Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT</DefineConstants>\r
+ <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_PAL;PFX_LEGACY_3_5;FEATURE_NETCORE;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_COMPILE;FEATURE_COMPILE_TO_METHODBUILDER;FEATURE_PDB_GENERATOR</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
</PropertyGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<ItemGroup>\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Collections\Generic\ArrayBuilder.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Collections\Generic\EnumerableHelpers.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Collections\Generic\LargeArrayBuilder.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Collections\Generic\ReferenceEqualityComparer.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Dynamic\Utils\CacheDict.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Dynamic\Utils\ContractUtils.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Dynamic\Utils\ContractUtils.RequiresArrayRange.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Dynamic\Utils\Error.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Dynamic\Utils\ExpressionUtils.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Dynamic\Utils\Strings.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Dynamic\Utils\TypeExtensions.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Dynamic\Utils\TypeUtils.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Linq\Expressions\Compiler\AssemblyGen.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Linq\Expressions\Compiler\DelegateHelpers.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\NotImplemented.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Dynamic\*.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Dynamic\Utils\CachedReflectionInfo.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Dynamic\Utils\CollectionExtensions.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Dynamic\Utils\EmptyReadOnlyCollection.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Dynamic\Utils\ExpressionUtils.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Dynamic\Utils\ExpressionVisitorUtils.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Dynamic\Utils\Helpers.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Dynamic\Utils\ListArgumentProvider.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Dynamic\Utils\ListParameterProvider.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Dynamic\Utils\TypeExtensions.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Dynamic\Utils\TypeUtils.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\*.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Common\ArrayBuilderExtensions.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Common\CachedReflectionInfo.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Common\ConstantCheck.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\AnalyzedTree.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\BoundConstants.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\CompilerScope.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\CompilerScope.Storage.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\DelegateHelpers.netstandard1.7.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\HoistedLocals.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\ILGen.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\KeyedQueue.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LabelInfo.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.Address.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.Binary.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.ControlFlow.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.Generated.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.Lambda.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.Logical.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\StackSpiller.Bindings.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\StackSpiller.ChildRewriter.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\StackSpiller.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\StackSpiller.Generated.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\StackSpiller.SpilledExpressionBlock.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\StackSpiller.Temps.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\TypeInfoExtensions.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\Expressions\Compiler\VariableBinder.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Linq\IQueryable.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\CallSite.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\CallSiteBinder.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\CallSiteHelpers.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\CallSiteOps.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\Closure.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\DebugInfoGenerator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\IRuntimeVariables.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\ReadOnlyCollectionBuilder.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\RuleCache.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\RuntimeOps.MergedRuntimeVariables.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\RuntimeOps.RuntimeVariableList.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\RuntimeOps.RuntimeVariables.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Expressions\src\System\Runtime\CompilerServices\TrueReadOnlyCollection.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Channels\AsynchronousChannel.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Channels\SynchronousChannel.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Enumerables\EmptyEnumerable.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Enumerables\EnumerableWrapperWeakToStrong.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Enumerables\IParallelPartitionable.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Enumerables\OrderedParallelQuery.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Enumerables\ParallelEnumerableWrapper.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Enumerables\ParallelQuery.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Enumerables\QueryAggregationOptions.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Enumerables\RangeEnumerable.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Enumerables\RepeatEnumerable.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Helpers.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Merging\ArrayMergeHelper.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Merging\DefaultMergeHelper.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Merging\IMergeHelper.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Merging\MergeEnumerator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Merging\MergeExecutor.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Merging\OrderPreservingMergeHelper.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Merging\SynchronousChannelMergeEnumerator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Partitioning\HashRepartitionStream.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Partitioning\IPartitionedStreamRecipient.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Partitioning\OrderedHashRepartitionStream.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Partitioning\PartitionedDataSource.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Partitioning\PartitionedStream.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Partitioning\UnorderedHashRepartitionStream.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Binary\ConcatQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Binary\HashJoinQueryOperatorEnumerator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\BinaryQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\CountAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\DecimalAverageAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\DecimalMinMaxAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\DecimalSumAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\DoubleAverageAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\DoubleMinMaxAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\DoubleSumAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\FloatAverageAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\FloatMinMaxAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\FloatSumAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperatorEnumerator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\IntAverageAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\IntSumAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\LongAverageAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\LongCountAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\LongMinMaxAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\LongSumAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalAverageAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalMinMaxAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalSumAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleAverageAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleMinMaxAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleSumAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableFloatAverageAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableFloatMinMaxAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableFloatSumAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableIntAverageAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableIntMinMaxAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableIntSumAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableLongAverageAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableLongMinMaxAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Inlined\NullableLongSumAggregationOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\ListQueryResults.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Options\OrderingQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Options\QueryExecutionOption.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\OrdinalIndexState.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\PartitionedStreamMerger.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\PartitionerQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\QueryOpeningEnumerator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\QueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\QueryOperatorEnumerator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\QueryResults.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\QuerySettings.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\ScanQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\IndexedSelectQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\LastQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\QueryOperators\UnaryQueryOperator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Scheduling\CancellationState.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Scheduling\QueryLifecycle.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Scheduling\QueryTask.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Scheduling\Scheduling.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Scheduling\SpoolingTask.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Scheduling\SpoolingTaskBase.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\CancellableEnumerable.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\ExceptionAggregator.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\ExchangeUtilities.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\FixedMaxHeap.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\GrowingArray.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\HashLookup.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\IntValueEvent.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\ListChunk.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\Lookup.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\Pair.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\PairComparer.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\PLINQETWProvider.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\ReverseComparer.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\Shared.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\Sorting.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\TraceHelpers.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\Util.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\Wrapper.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\Parallel\Utils\WrapperEqualityComparer.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\ParallelEnumerable.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\ParallelExecutionMode.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Parallel\src\System\Linq\ParallelMergeOptions.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Queryable\src\System\Linq\CachedReflection.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Queryable\src\System\Linq\EnumerableExecutor.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Queryable\src\System\Linq\EnumerableQuery.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Queryable\src\System\Linq\EnumerableRewriter.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Queryable\src\System\Linq\Error.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Queryable\src\System\Linq\Queryable.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Queryable\src\System\Linq\Strings.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq.Queryable\src\System\Linq\TypeHelper.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Linq\src\System\Linq\*.cs" />\r
<Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
<Compile Include="..\..\build\common\SR.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\BinaryOperationBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\BindingRestrictions.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\CallInfo.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\CallSite.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\CallSiteBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\CallSiteHelpers.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\CallSiteOps.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\ConvertBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\CreateInstanceBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\DeleteIndexBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\DeleteMemberBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\DynamicMetaObject.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\DynamicMetaObjectBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\DynamicObject.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\ExpandoClass.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\ExpandoObject.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\GetIndexBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\GetMemberBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\IDynamicMetaObjectProvider.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\IInvokeOnGetBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\InvokeBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\InvokeMemberBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\RuleCache.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\SetIndexBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\SetMemberBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\UnaryOperationBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\BinaryExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\BlockExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\CatchBlock.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\ConditionalExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\ConstantExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\DebugInfoExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\DebugViewWriter.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\DefaultExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\ElementInit.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\Expression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\Expression.DebuggerProxy.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\ExpressionStringBuilder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\ExpressionType.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\GotoExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\IndexExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\InvocationExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\LabelExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\LabelTarget.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\LambdaExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\ListArgumentProvider.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\ListInitExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\LoopExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\MemberAssignment.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\MemberBinding.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\MemberExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\MemberInitExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\MemberListBinding.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\MemberMemberBinding.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\MethodCallExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\NewArrayExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\NewExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\ParameterExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\RuntimeVariablesExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\SwitchCase.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\SwitchExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\SymbolDocumentInfo.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\TryExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\TypeBinaryExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\TypeUtils.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Ast\UnaryExpression.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\AnalyzedTree.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\AssemblyGen.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\BoundConstants.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\Closure.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\CompilerScope.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\CompilerScope.Storage.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\ConstantCheck.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\DebugInfoGenerator.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\DelegateHelpers.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\DelegateHelpers.Generated.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\ExpressionQuoter.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\HoistedLocals.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\ILGen.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\KeyedQueue.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\LabelInfo.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\LambdaCompiler.Address.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\LambdaCompiler.Binary.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\LambdaCompiler.ControlFlow.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\LambdaCompiler.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\LambdaCompiler.Expressions.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\LambdaCompiler.Generated.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\LambdaCompiler.Lambda.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\LambdaCompiler.Logical.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\LambdaCompiler.Statements.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\LambdaCompiler.Unary.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\OffsetTrackingILGenerator.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\RuntimeVariableList.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\Set.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\StackSpiller.Bindings.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\StackSpiller.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\StackSpiller.Generated.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\StackSpiller.Temps.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\SymbolDocumentGenerator.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\SymbolGuids.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Compiler\VariableBinder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\CacheDict.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\CollectionExtensions.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\ContractUtils.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\ExceptionFactory.Generated.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\Helpers.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\IRuntimeVariables.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\ReadOnlyCollectionBuilder.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\ReadOnlyDictionary.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\ReferenceEqualityComparer.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\ReflectionUtils.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\TrueReadOnlyCollection.cs" />\r
- <Compile Include="..\dlr\Runtime\Microsoft.Scripting.Core\Utils\TypeExtensions.cs" />\r
- <Compile Include="..\referencesource\System.Core\Microsoft\Scripting\Ast\DynamicExpression.cs" />\r
- <Compile Include="..\referencesource\System.Core\Microsoft\Scripting\Ast\ExpressionVisitor.cs" />\r
- <Compile Include="..\referencesource\System.Core\Microsoft\Scripting\Ast\IArgumentProvider.cs" />\r
- <Compile Include="..\referencesource\System.Core\Microsoft\Scripting\Ast\IDynamicExpression.cs" />\r
<Compile Include="..\referencesource\System.Core\Microsoft\Scripting\Utils\Action.cs" />\r
<Compile Include="..\referencesource\System.Core\Microsoft\Scripting\Utils\Extension.cs" />\r
<Compile Include="..\referencesource\System.Core\Microsoft\Scripting\Utils\Function.cs" />\r
<Compile Include="..\referencesource\System.Core\System\IO\MemoryMappedFiles\MemoryMappedFileSecurity.cs" />\r
<Compile Include="..\referencesource\System.Core\System\IO\MemoryMappedFiles\MemoryMappedViewAccessor.cs" />\r
<Compile Include="..\referencesource\System.Core\System\IO\MemoryMappedFiles\MemoryMappedViewStream.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Enumerable.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Expressions\ExpressionVisitor.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\IQueryable.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Channels\AsynchronousChannel.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Channels\SynchronousChannel.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Enumerables\EmptyEnumerable.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Enumerables\EnumerableWrapperWeakToStrong.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Enumerables\IParallelPartitionable.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Enumerables\OrderedParallelQuery.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Enumerables\ParallelEnumerableWrapper.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Enumerables\ParallelQuery.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Enumerables\QueryAggregationOptions.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Enumerables\RangeEnumerable.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Enumerables\RepeatEnumerable.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Merging\ArrayMergeHelper.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Merging\DefaultMergeHelper.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Merging\IMergeHelper.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Merging\MergeEnumerator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Merging\MergeExecutor.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Merging\OrderPreservingMergeHelper.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Merging\SynchronousChannelMergeEnumerator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Partitioning\HashRepartitionStream.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Partitioning\IPartitionedStreamRecipient.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Partitioning\OrderedHashRepartitionStream.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Partitioning\PartitionedDataSource.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Partitioning\PartitionedStream.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Partitioning\UnorderedHashRepartitionStream.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Binary\HashJoinQueryOperatorEnumerator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\BinaryQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\CountAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\DecimalAverageAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\DecimalMinMaxAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\DecimalSumAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\DoubleAverageAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\DoubleMinMaxAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\DoubleSumAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\FloatAverageAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\FloatMinMaxAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\FloatSumAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperatorEnumerator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\IntAverageAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\IntSumAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\LongAverageAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\LongCountAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\LongMinMaxAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\LongSumAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalAverageAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalMinMaxAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalSumAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleAverageAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleMinMaxAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleSumAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableFloatAverageAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableFloatMinMaxAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableFloatSumAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableIntAverageAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableIntMinMaxAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableIntSumAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableLongAverageAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableLongMinMaxAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Inlined\NullableLongSumAggregationOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\ListQueryResults.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Options\OrderingQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Options\QueryExecutionOption.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\OrdinalIndexState.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\PartitionedStreamMerger.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\PartitionerQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\QueryOpeningEnumerator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\QueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\QueryOperatorEnumerator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\QueryResults.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\QuerySettings.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\ScanQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\ConcatQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\IndexedSelectQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\LastQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\QueryOperators\UnaryQueryOperator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Scheduling\CancellationState.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Scheduling\QueryLifecycle.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Scheduling\QueryTask.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Scheduling\Scheduling.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Scheduling\SpoolingTask.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Scheduling\SpoolingTaskBase.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\CancellableEnumerable.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\ExceptionAggregator.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\ExchangeUtilities.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\FixedMaxHeap.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\GrowingArray.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\HashLookup.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\IntValueEvent.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\ListChunk.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\Lookup.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\Pair.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\PairComparer.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\ReverseComparer.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\Shared.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\Sorting.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\TraceHelpers.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\Util.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\Wrapper.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\Parallel\Utils\WrapperEqualityComparer.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\ParallelEnumerable.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\ParallelExecutionMode.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\ParallelMergeOptions.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\SequenceQuery.cs" />\r
- <Compile Include="..\referencesource\System.Core\System\Linq\TypeHelper.cs" />\r
<Compile Include="..\referencesource\System.Core\System\Runtime\CompilerServices\DynamicAttribute.cs" />\r
<Compile Include="..\referencesource\System.Core\System\Runtime\CompilerServices\ExecutionScope.cs" />\r
<Compile Include="..\referencesource\System.Core\System\Security\Cryptography\Aes.cs" />\r
<Compile Include="..\referencesource\System.Core\System\TimeZoneInfo.cs" />\r
<Compile Include="..\referencesource\System.Core\System\TimeZoneNotFoundException.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
+ <Compile Include="corefx\LambdaExpression.cs" />\r
+ <Compile Include="corefx\SR.cs" />\r
+ <Compile Include="corefx\SR.missing.cs" />\r
<Compile Include="Microsoft.Win32.SafeHandles\SafeMemoryMappedFileHandle.cs" />\r
<Compile Include="Microsoft.Win32.SafeHandles\SafeMemoryMappedViewHandle.cs" />\r
<Compile Include="Microsoft.Win32.SafeHandles\SafeNCryptHandle.cs" />\r
<Compile Include="Microsoft.Win32.SafeHandles\SafeNCryptProviderHandle.cs" />\r
<Compile Include="Microsoft.Win32.SafeHandles\SafeNCryptSecretHandle.cs" />\r
<Compile Include="Microsoft.Win32.SafeHandles\SafePipeHandle.cs" />\r
- <Compile Include="ReferenceSources\Error.cs" />\r
<Compile Include="ReferenceSources\SR.cs" />\r
<Compile Include="ReferenceSources\SR.missing.cs" />\r
- <Compile Include="ReferenceSources\Strings.cs" />\r
<Compile Include="System.IO.MemoryMappedFiles\MemoryMappedFile.cs" />\r
<Compile Include="System.IO.MemoryMappedFiles\MemoryMappedView.cs" />\r
<Compile Include="System.IO.Pipes\AnonymousPipeClientStream.cs" />\r
<DebugType>full</DebugType>\r
<NoWarn>1699</NoWarn>\r
<Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_TYPECONVERTER</DefineConstants>\r
+ <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_TYPECONVERTER;SUPPORTS_WINDOWS_COLORS</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<DebugType>pdbonly</DebugType>\r
<NoWarn>1699</NoWarn>\r
<Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_TYPECONVERTER</DefineConstants>\r
+ <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;FEATURE_TYPECONVERTER;SUPPORTS_WINDOWS_COLORS</DefineConstants>\r
<ErrorReport>prompt</ErrorReport>\r
<WarningLevel>4</WarningLevel>\r
</PropertyGroup>\r
<NoStdLib>True</NoStdLib>\r
\r
<NoConfig>True</NoConfig>\r
- \r
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
<AppDesignerFolder>Properties</AppDesignerFolder>\r
<RootNamespace>\r
</RootNamespace>\r
</PropertyGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<ItemGroup>\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\IO\PathInternal.CaseSensitivity.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Buffers\src\System\Buffers\ArrayPool.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Buffers\src\System\Buffers\ArrayPoolEventSource.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Buffers\src\System\Buffers\DefaultArrayPool.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Buffers\src\System\Buffers\DefaultArrayPoolBucket.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Buffers\src\System\Buffers\Utilities.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression.ZipFile\src\System\IO\Compression\ZipFile.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression.ZipFile\src\System\IO\Compression\ZipFileExtensions.cs" />\r
<Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
<Compile Include="AssemblyInfo.cs" />\r
- <Compile Include="ZipFile.cs" />\r
- <Compile Include="ZipFileExtensions.cs" />\r </ItemGroup>\r
+ <Compile Include="corefx\SR.cs" />\r </ItemGroup>\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
Other similar extension points exist, see Microsoft.Common.targets.\r
<Target Name="BeforeBuild">\r
include ../../build/rules.make
LIBRARY = System.IO.Compression.dll
-LIB_REFS = System System.Core
-LIB_MCS_FLAGS = /unsafe
+LIB_REFS = System
+LIB_MCS_FLAGS =
TEST_MCS_FLAGS =
TEST_LIB_REFS = System System.Core
+RESX_RESOURCE_STRING = \
+ ../../../external/corefx/src/System.IO.Compression/src/Resources/Strings.resx
+
include ../../build/library.make
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using SharpCompress.Common;
-using SharpCompress.Reader;
-
-namespace SharpCompress.Archive
-{
- internal abstract class AbstractArchive<TEntry, TVolume> : IArchive, IArchiveExtractionListener
- where TEntry : IArchiveEntry
- where TVolume : IVolume
- {
- private readonly LazyReadOnlyCollection<TVolume> lazyVolumes;
- private readonly LazyReadOnlyCollection<TEntry> lazyEntries;
-
- public event EventHandler<ArchiveExtractionEventArgs<IArchiveEntry>> EntryExtractionBegin;
- public event EventHandler<ArchiveExtractionEventArgs<IArchiveEntry>> EntryExtractionEnd;
-
- public event EventHandler<CompressedBytesReadEventArgs> CompressedBytesRead;
- public event EventHandler<FilePartExtractionBeginEventArgs> FilePartExtractionBegin;
-
- protected string Password { get; private set; }
-
-#if !PORTABLE && !NETFX_CORE
- internal AbstractArchive(ArchiveType type, FileInfo fileInfo, Options options, string password)
- {
- Type = type;
- Password = password;
- if (!fileInfo.Exists)
- {
- throw new ArgumentException("File does not exist: " + fileInfo.FullName);
- }
- options = (Options) FlagUtility.SetFlag(options, Options.KeepStreamsOpen, false);
- lazyVolumes = new LazyReadOnlyCollection<TVolume>(LoadVolumes(fileInfo, options));
- lazyEntries = new LazyReadOnlyCollection<TEntry>(LoadEntries(Volumes));
- }
-
-
- protected abstract IEnumerable<TVolume> LoadVolumes(FileInfo file, Options options);
-#endif
-
- internal AbstractArchive(ArchiveType type, IEnumerable<Stream> streams, Options options, string password)
- {
- Type = type;
- Password = password;
- lazyVolumes = new LazyReadOnlyCollection<TVolume>(LoadVolumes(streams.Select(CheckStreams), options));
- lazyEntries = new LazyReadOnlyCollection<TEntry>(LoadEntries(Volumes));
- }
-
- internal AbstractArchive(ArchiveType type)
- {
- Type = type;
- lazyVolumes = new LazyReadOnlyCollection<TVolume>(Enumerable.Empty<TVolume>());
- lazyEntries = new LazyReadOnlyCollection<TEntry>(Enumerable.Empty<TEntry>());
- }
- public ArchiveType Type { get; private set; }
-
- void IArchiveExtractionListener.FireEntryExtractionBegin(IArchiveEntry entry)
- {
- if (EntryExtractionBegin != null)
- {
- EntryExtractionBegin(this, new ArchiveExtractionEventArgs<IArchiveEntry>(entry));
- }
- }
-
- void IArchiveExtractionListener.FireEntryExtractionEnd(IArchiveEntry entry)
- {
- if (EntryExtractionEnd != null)
- {
- EntryExtractionEnd(this, new ArchiveExtractionEventArgs<IArchiveEntry>(entry));
- }
- }
-
- private static Stream CheckStreams(Stream stream)
- {
- if (!stream.CanSeek || !stream.CanRead)
- {
- throw new ArgumentException("Archive streams must be Readable and Seekable");
- }
- return stream;
- }
-
- /// <summary>
- /// Returns an ReadOnlyCollection of all the RarArchiveEntries across the one or many parts of the RarArchive.
- /// </summary>
- /// <returns></returns>
- public virtual ICollection<TEntry> Entries
- {
- get { return lazyEntries; }
- }
-
- /// <summary>
- /// Returns an ReadOnlyCollection of all the RarArchiveVolumes across the one or many parts of the RarArchive.
- /// </summary>
- /// <returns></returns>
- public ICollection<TVolume> Volumes
- {
- get { return lazyVolumes; }
- }
-
- /// <summary>
- /// The total size of the files compressed in the archive.
- /// </summary>
- public long TotalSize
- {
- get { return Entries.Aggregate(0L, (total, cf) => total + cf.CompressedSize); }
- }
-
- protected abstract IEnumerable<TVolume> LoadVolumes(IEnumerable<Stream> streams, Options options);
- protected abstract IEnumerable<TEntry> LoadEntries(IEnumerable<TVolume> volumes);
-
- IEnumerable<IArchiveEntry> IArchive.Entries
- {
- get { return Entries.Cast<IArchiveEntry>(); }
- }
-
- IEnumerable<IVolume> IArchive.Volumes
- {
- get { return lazyVolumes.Cast<IVolume>(); }
- }
-
- private bool disposed;
-
- public virtual void Dispose()
- {
- if (!disposed)
- {
- lazyVolumes.ForEach(v => v.Dispose());
- lazyEntries.GetLoaded().Cast<Entry>().ForEach(x => x.Close());
- disposed = true;
- }
- }
-
- void IArchiveExtractionListener.EnsureEntriesLoaded()
- {
- lazyEntries.EnsureFullyLoaded();
- lazyVolumes.EnsureFullyLoaded();
- }
-
- void IExtractionListener.FireCompressedBytesRead(long currentPartCompressedBytes, long compressedReadBytes)
- {
- if (CompressedBytesRead != null)
- {
- CompressedBytesRead(this, new CompressedBytesReadEventArgs()
- {
- CurrentFilePartCompressedBytesRead = currentPartCompressedBytes,
- CompressedBytesRead = compressedReadBytes
- });
- }
- }
-
- void IExtractionListener.FireFilePartExtractionBegin(string name, long size, long compressedSize)
- {
- if (FilePartExtractionBegin != null)
- {
- FilePartExtractionBegin(this, new FilePartExtractionBeginEventArgs()
- {
- CompressedSize = compressedSize,
- Size = size,
- Name = name,
- });
- }
- }
-
- /// <summary>
- /// Use this method to extract all entries in an archive in order.
- /// This is primarily for SOLID Rar Archives or 7Zip Archives as they need to be
- /// extracted sequentially for the best performance.
- ///
- /// This method will load all entry information from the archive.
- ///
- /// WARNING: this will reuse the underlying stream for the archive. Errors may
- /// occur if this is used at the same time as other extraction methods on this instance.
- /// </summary>
- /// <returns></returns>
- public IReader ExtractAllEntries()
- {
- ((IArchiveExtractionListener)this).EnsureEntriesLoaded();
- return CreateReaderForSolidExtraction();
- }
-
- protected abstract IReader CreateReaderForSolidExtraction();
-
- /// <summary>
- /// Archive is SOLID (this means the Archive saved bytes by reusing information which helps for archives containing many small files).
- /// </summary>
- public virtual bool IsSolid
- {
- get { return false; }
- }
-
-
- /// <summary>
- /// The archive can find all the parts of the archive needed to fully extract the archive. This forces the parsing of the entire archive.
- /// </summary>
- public bool IsComplete
- {
- get
- {
- ((IArchiveExtractionListener)this).EnsureEntriesLoaded();
- return Entries.All(x => x.IsComplete);
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using SharpCompress.Common;
-
-namespace SharpCompress.Archive
-{
- internal static class AbstractWritableArchiveExtensions
- {
- public static void SaveTo<TEntry, TVolume>(this AbstractWritableArchive<TEntry, TVolume> writableArchive,
- Stream stream, CompressionType compressionType)
- where TEntry : IArchiveEntry
- where TVolume : IVolume
- {
- writableArchive.SaveTo(stream, new CompressionInfo {Type = compressionType});
- }
-
-#if !PORTABLE && !NETFX_CORE
-
- public static void AddEntry<TEntry, TVolume>(this AbstractWritableArchive<TEntry, TVolume> writableArchive,
- string entryPath, string filePath)
- where TEntry : IArchiveEntry
- where TVolume : IVolume
- {
- var fileInfo = new FileInfo(filePath);
- if (!fileInfo.Exists)
- {
- throw new FileNotFoundException("Could not AddEntry: " + filePath);
- }
- writableArchive.AddEntry(entryPath, new FileInfo(filePath).OpenRead(), true, fileInfo.Length,
- fileInfo.LastWriteTime);
- }
-
- public static void SaveTo<TEntry, TVolume>(this AbstractWritableArchive<TEntry, TVolume> writableArchive,
- string filePath, CompressionType compressionType)
- where TEntry : IArchiveEntry
- where TVolume : IVolume
- {
- writableArchive.SaveTo(new FileInfo(filePath), new CompressionInfo {Type = compressionType});
- }
-
- public static void SaveTo<TEntry, TVolume>(this AbstractWritableArchive<TEntry, TVolume> writableArchive,
- FileInfo fileInfo, CompressionType compressionType)
- where TEntry : IArchiveEntry
- where TVolume : IVolume
- {
- using (var stream = fileInfo.Open(FileMode.Create, FileAccess.Write))
- {
- writableArchive.SaveTo(stream, new CompressionInfo {Type = compressionType});
- }
- }
-
- public static void SaveTo<TEntry, TVolume>(this AbstractWritableArchive<TEntry, TVolume> writableArchive,
- string filePath, CompressionInfo compressionInfo)
- where TEntry : IArchiveEntry
- where TVolume : IVolume
- {
- writableArchive.SaveTo(new FileInfo(filePath), compressionInfo);
- }
-
- public static void SaveTo<TEntry, TVolume>(this AbstractWritableArchive<TEntry, TVolume> writableArchive,
- FileInfo fileInfo, CompressionInfo compressionInfo)
- where TEntry : IArchiveEntry
- where TVolume : IVolume
- {
- using (var stream = fileInfo.Open(FileMode.Create, FileAccess.Write))
- {
- writableArchive.SaveTo(stream, compressionInfo);
- }
- }
-
- public static void AddAllFromDirectory<TEntry, TVolume>(
- this AbstractWritableArchive<TEntry, TVolume> writableArchive,
- string filePath, string searchPattern = "*.*", SearchOption searchOption = SearchOption.AllDirectories)
- where TEntry : IArchiveEntry
- where TVolume : IVolume
- {
-#if NET2
- foreach (var path in Directory.GetFiles(filePath, searchPattern, searchOption))
-#else
- foreach (var path in Directory.EnumerateFiles(filePath, searchPattern, searchOption))
-#endif
- {
- var fileInfo = new FileInfo(path);
- writableArchive.AddEntry(path.Substring(filePath.Length), fileInfo.OpenRead(), true, fileInfo.Length,
- fileInfo.LastWriteTime);
- }
- }
- public static TEntry AddEntry<TEntry, TVolume>(this AbstractWritableArchive<TEntry, TVolume> writableArchive, string key, FileInfo fileInfo)
- where TEntry : IArchiveEntry
- where TVolume : IVolume
- {
- if (!fileInfo.Exists)
- {
- throw new ArgumentException("FileInfo does not exist.");
- }
- return writableArchive.AddEntry(key, fileInfo.OpenRead(), true, fileInfo.Length, fileInfo.LastWriteTime);
- }
-#endif
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using SharpCompress.Common;
-
-namespace SharpCompress.Archive
-{
- internal abstract class AbstractWritableArchive<TEntry, TVolume> : AbstractArchive<TEntry, TVolume>
- where TEntry : IArchiveEntry
- where TVolume : IVolume
- {
- private readonly List<TEntry> newEntries = new List<TEntry>();
- private readonly List<TEntry> removedEntries = new List<TEntry>();
-
- private readonly List<TEntry> modifiedEntries = new List<TEntry>();
- private bool hasModifications;
-
- internal AbstractWritableArchive(ArchiveType type)
- : base(type)
- {
- }
-
- internal AbstractWritableArchive(ArchiveType type, Stream stream, Options options)
- : base(type, stream.AsEnumerable(), options, null)
- {
- }
-
-#if !PORTABLE && !NETFX_CORE
- internal AbstractWritableArchive(ArchiveType type, FileInfo fileInfo, Options options)
- : base(type, fileInfo, options, null)
- {
- }
-#endif
-
- public override ICollection<TEntry> Entries
- {
- get
- {
- if (hasModifications)
- {
- return modifiedEntries;
- }
- return base.Entries;
- }
- }
-
- private void RebuildModifiedCollection()
- {
- hasModifications = true;
- newEntries.RemoveAll(v => removedEntries.Contains(v));
- modifiedEntries.Clear();
- modifiedEntries.AddRange(OldEntries.Concat(newEntries));
- }
-
- private IEnumerable<TEntry> OldEntries
- {
- get { return base.Entries.Where(x => !removedEntries.Contains(x)); }
- }
-
- public void RemoveEntry(TEntry entry)
- {
- if (!removedEntries.Contains(entry))
- {
- removedEntries.Add(entry);
- RebuildModifiedCollection();
- }
- }
-
- public TEntry AddEntry(string key, Stream source,
- long size = 0, DateTime? modified = null)
- {
- return AddEntry(key, source, false, size, modified);
- }
-
- public TEntry AddEntry(string key, Stream source, bool closeStream,
- long size = 0, DateTime? modified = null)
- {
- if (key.StartsWith("/")
- || key.StartsWith("\\"))
- {
- key = key.Substring(1);
- }
- // .NET allows duplicate entries when saving and loading Zip files.
- // The following lines are disabled from upstream SharpCompress to allow this.
-#if ZIP_ALLOW_DUPLICATE_KEYS
- if (DoesKeyMatchExisting(key))
- {
- throw new ArchiveException("Cannot add entry with duplicate key: " + key);
- }
-#endif
- var entry = CreateEntry(key, source, size, modified, closeStream);
- newEntries.Add(entry);
- RebuildModifiedCollection();
- return entry;
- }
-
- private bool DoesKeyMatchExisting(string key)
- {
- foreach (var path in Entries.Select(x => x.Key))
- {
- var p = path.Replace('/','\\');
- if (p.StartsWith("\\"))
- {
- p = p.Substring(1);
- }
- if (string.Equals(p, key, StringComparison.OrdinalIgnoreCase))
- return true;
- }
- return false;
- }
-
- public void SaveTo(Stream stream, CompressionInfo compressionType, Encoding encoding = null)
- {
- //reset streams of new entries
- newEntries.Cast<IWritableArchiveEntry>().ForEach(x => x.Stream.Seek(0, SeekOrigin.Begin));
- SaveTo(stream, compressionType, encoding ?? ArchiveEncoding.Default, OldEntries, newEntries);
- }
-
- protected TEntry CreateEntry(string key, Stream source, long size, DateTime? modified,
- bool closeStream)
- {
- if (!source.CanRead || !source.CanSeek)
- {
- throw new ArgumentException("Streams must be readable and seekable to use the Writing Archive API");
- }
- return CreateEntryInternal(key, source, size, modified, closeStream);
- }
-
- protected abstract TEntry CreateEntryInternal(string key, Stream source, long size, DateTime? modified,
- bool closeStream);
-
- protected abstract void SaveTo(Stream stream, CompressionInfo compressionType, Encoding encoding,
- IEnumerable<TEntry> oldEntries, IEnumerable<TEntry> newEntries);
-
- public override void Dispose()
- {
- base.Dispose();
- newEntries.Cast<Entry>().ForEach(x => x.Close());
- removedEntries.Cast<Entry>().ForEach(x => x.Close());
- modifiedEntries.Cast<Entry>().ForEach(x => x.Close());
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-#if GZIP
-using SharpCompress.Archive.GZip;
-#endif
-#if RAR
-using SharpCompress.Archive.Rar;
-#endif
-#if SEVENZIP
-using SharpCompress.Archive.SevenZip;
-#endif
-#if TAR
-using SharpCompress.Archive.Tar;
-#endif
-using SharpCompress.Archive.Zip;
-using SharpCompress.Common;
-
-namespace SharpCompress.Archive
-{
- internal class ArchiveFactory
- {
- /// <summary>
- /// Opens an Archive for random access
- /// </summary>
- /// <param name="stream"></param>
- /// <param name="options"></param>
- /// <returns></returns>
- public static IArchive Open(Stream stream, Options options = Options.KeepStreamsOpen)
- {
- stream.CheckNotNull("stream");
- if (!stream.CanRead || !stream.CanSeek)
- {
- throw new ArgumentException("Stream should be readable and seekable");
- }
-
- if (ZipArchive.IsZipFile(stream, null))
- {
- stream.Seek(0, SeekOrigin.Begin);
- return ZipArchive.Open(stream, options, null);
- }
-#if RAR
- stream.Seek(0, SeekOrigin.Begin);
- if (RarArchive.IsRarFile(stream, Options.LookForHeader | Options.KeepStreamsOpen))
- {
- stream.Seek(0, SeekOrigin.Begin);
- return RarArchive.Open(stream, options);
- }
-#endif
-#if TAR
- stream.Seek(0, SeekOrigin.Begin);
- if (TarArchive.IsTarFile(stream))
- {
- stream.Seek(0, SeekOrigin.Begin);
- return TarArchive.Open(stream, options);
- }
-#endif
-#if SEVENZIP
- stream.Seek(0, SeekOrigin.Begin);
- if (SevenZipArchive.IsSevenZipFile(stream))
- {
- stream.Seek(0, SeekOrigin.Begin);
- return SevenZipArchive.Open(stream, options);
- }
-#endif
-#if GZIP
- stream.Seek(0, SeekOrigin.Begin);
- if (GZipArchive.IsGZipFile(stream))
- {
- stream.Seek(0, SeekOrigin.Begin);
- return GZipArchive.Open(stream, options);
- }
-#endif
- throw new InvalidOperationException("Cannot determine compressed stream type. Supported Archive Formats: Zip, GZip, Tar, Rar, 7Zip");
- }
-
- public static IArchive Create(ArchiveType type)
- {
- switch (type)
- {
- case ArchiveType.Zip:
- {
- return ZipArchive.Create();
- }
-#if TAR
- case ArchiveType.Tar:
- {
- return TarArchive.Create();
- }
-#endif
- default:
- {
- throw new NotSupportedException("Cannot create Archives of type: " + type);
- }
- }
- }
-
-#if !PORTABLE && !NETFX_CORE
- /// <summary>
- /// Constructor expects a filepath to an existing file.
- /// </summary>
- /// <param name="filePath"></param>
- public static IArchive Open(string filePath)
- {
- return Open(filePath, Options.None);
- }
-
- /// <summary>
- /// Constructor with a FileInfo object to an existing file.
- /// </summary>
- /// <param name="fileInfo"></param>
- public static IArchive Open(FileInfo fileInfo)
- {
- return Open(fileInfo, Options.None);
- }
-
- /// <summary>
- /// Constructor expects a filepath to an existing file.
- /// </summary>
- /// <param name="filePath"></param>
- /// <param name="options"></param>
- public static IArchive Open(string filePath, Options options)
- {
- filePath.CheckNotNullOrEmpty("filePath");
- return Open(new FileInfo(filePath), options);
- }
-
- /// <summary>
- /// Constructor with a FileInfo object to an existing file.
- /// </summary>
- /// <param name="fileInfo"></param>
- /// <param name="options"></param>
- public static IArchive Open(FileInfo fileInfo, Options options)
- {
- fileInfo.CheckNotNull("fileInfo");
- using (var stream = fileInfo.OpenRead())
- {
- if (ZipArchive.IsZipFile(stream, null))
- {
- stream.Dispose();
- return ZipArchive.Open(fileInfo, options, null);
- }
-#if RAR
- stream.Seek(0, SeekOrigin.Begin);
- if (RarArchive.IsRarFile(stream, Options.LookForHeader | Options.KeepStreamsOpen))
- {
- stream.Dispose();
- return RarArchive.Open(fileInfo, options);
- }
-#endif
-#if TAR
- stream.Seek(0, SeekOrigin.Begin);
- if (TarArchive.IsTarFile(stream))
- {
- stream.Dispose();
- return TarArchive.Open(fileInfo, options);
- }
-#endif
-#if SEVENZIP
- stream.Seek(0, SeekOrigin.Begin);
- if (SevenZipArchive.IsSevenZipFile(stream))
- {
- stream.Dispose();
- return SevenZipArchive.Open(fileInfo, options);
- }
-#endif
-#if GZIP
- stream.Seek(0, SeekOrigin.Begin);
- if (GZipArchive.IsGZipFile(stream))
- {
- stream.Dispose();
- return GZipArchive.Open(fileInfo, options);
- }
-#endif
- throw new InvalidOperationException("Cannot determine compressed stream type.");
- }
- }
-
- /// <summary>
- /// Extract to specific directory, retaining filename
- /// </summary>
- public static void WriteToDirectory(string sourceArchive, string destinationDirectory,
- ExtractOptions options = ExtractOptions.Overwrite)
- {
- using (IArchive archive = Open(sourceArchive))
- {
- foreach (IArchiveEntry entry in archive.Entries)
- {
- entry.WriteToDirectory(destinationDirectory, options);
- }
- }
- }
-#endif
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Linq;
-using SharpCompress.Common;
-
-namespace SharpCompress.Archive
-{
- internal static class IArchiveExtensions
- {
-#if !PORTABLE && !NETFX_CORE
- /// <summary>
- /// Extract to specific directory, retaining filename
- /// </summary>
- public static void WriteToDirectory(this IArchive archive, string destinationDirectory,
- ExtractOptions options = ExtractOptions.Overwrite)
- {
- foreach (IArchiveEntry entry in archive.Entries.Where(x => !x.IsDirectory))
- {
- entry.WriteToDirectory(destinationDirectory, options);
- }
- }
-#endif
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using SharpCompress.Common;
-using SharpCompress.Reader;
-
-namespace SharpCompress.Archive
-{
- internal interface IArchive : IDisposable
- {
- event EventHandler<ArchiveExtractionEventArgs<IArchiveEntry>> EntryExtractionBegin;
- event EventHandler<ArchiveExtractionEventArgs<IArchiveEntry>> EntryExtractionEnd;
-
- event EventHandler<CompressedBytesReadEventArgs> CompressedBytesRead;
- event EventHandler<FilePartExtractionBeginEventArgs> FilePartExtractionBegin;
-
- IEnumerable<IArchiveEntry> Entries { get; }
- long TotalSize { get; }
- IEnumerable<IVolume> Volumes { get; }
-
- ArchiveType Type { get; }
-
- /// <summary>
- /// Use this method to extract all entries in an archive in order.
- /// This is primarily for SOLID Rar Archives or 7Zip Archives as they need to be
- /// extracted sequentially for the best performance.
- /// </summary>
- /// <returns></returns>
- IReader ExtractAllEntries();
-
- /// <summary>
- /// Archive is SOLID (this means the Archive saved bytes by reusing information which helps for archives containing many small files).
- /// Rar Archives can be SOLID while all 7Zip archives are considered SOLID.
- /// </summary>
- bool IsSolid { get; }
-
- /// <summary>
- /// This checks to see if all the known entries have IsComplete = true
- /// </summary>
- bool IsComplete { get; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-using SharpCompress.Common;
-using SharpCompress.IO;
-
-namespace SharpCompress.Archive
-{
- internal static class IArchiveEntryExtensions
- {
- public static void WriteTo(this IArchiveEntry archiveEntry, Stream streamToWriteTo)
- {
- if (archiveEntry.Archive.Type == ArchiveType.Rar && archiveEntry.Archive.IsSolid)
- {
- throw new InvalidFormatException("Cannot use Archive random access on SOLID Rar files.");
- }
-
- if (archiveEntry.IsDirectory)
- {
- throw new ExtractionException("Entry is a file directory and cannot be extracted.");
- }
-
- var streamListener = archiveEntry.Archive as IArchiveExtractionListener;
- streamListener.EnsureEntriesLoaded();
- streamListener.FireEntryExtractionBegin(archiveEntry);
- streamListener.FireFilePartExtractionBegin(archiveEntry.Key, archiveEntry.Size, archiveEntry.CompressedSize);
- var entryStream = archiveEntry.OpenEntryStream();
- if (entryStream == null)
- {
- return;
- }
- using(entryStream)
- using (Stream s = new ListeningStream(streamListener, entryStream))
- {
- s.TransferTo(streamToWriteTo);
- }
- streamListener.FireEntryExtractionEnd(archiveEntry);
- }
-
-#if !PORTABLE && !NETFX_CORE
- /// <summary>
- /// Extract to specific directory, retaining filename
- /// </summary>
- public static void WriteToDirectory(this IArchiveEntry entry, string destinationDirectory,
- ExtractOptions options = ExtractOptions.Overwrite)
- {
- string destinationFileName;
- string file = Path.GetFileName(entry.Key);
-
-
- if (options.HasFlag(ExtractOptions.ExtractFullPath))
- {
- string folder = Path.GetDirectoryName(entry.Key);
- string destdir = Path.Combine(destinationDirectory, folder);
- if (!Directory.Exists(destdir))
- {
- Directory.CreateDirectory(destdir);
- }
- destinationFileName = Path.Combine(destdir, file);
- }
- else
- {
- destinationFileName = Path.Combine(destinationDirectory, file);
- }
- entry.WriteToFile(destinationFileName, options);
- }
-
- /// <summary>
- /// Extract to specific file
- /// </summary>
- public static void WriteToFile(this IArchiveEntry entry, string destinationFileName,
- ExtractOptions options = ExtractOptions.Overwrite)
- {
- if (entry.IsDirectory)
- {
- return;
- }
- FileMode fm = FileMode.Create;
-
- if (!options.HasFlag(ExtractOptions.Overwrite))
- {
- fm = FileMode.CreateNew;
- }
- using (FileStream fs = File.Open(destinationFileName, fm))
- {
- entry.WriteTo(fs);
- }
- }
-#endif
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-using SharpCompress.Common;
-
-namespace SharpCompress.Archive
-{
- internal interface IArchiveEntry : IEntry
- {
- /// <summary>
- /// Opens the current entry as a stream that will decompress as it is read.
- /// Read the entire stream or use SkipEntry on EntryStream.
- /// </summary>
- Stream OpenEntryStream();
-
- /// <summary>
- /// The archive can find all the parts of the archive needed to extract this entry.
- /// </summary>
- bool IsComplete { get; }
-
- /// <summary>
- /// The archive instance this entry belongs to
- /// </summary>
- IArchive Archive { get; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using SharpCompress.Common;
-
-namespace SharpCompress.Archive
-{
- internal interface IArchiveExtractionListener : IExtractionListener
- {
- void EnsureEntriesLoaded();
- void FireEntryExtractionBegin(IArchiveEntry entry);
- void FireEntryExtractionEnd(IArchiveEntry entry);
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-
-namespace SharpCompress.Archive
-{
- internal interface IWritableArchiveEntry
- {
- Stream Stream { get; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using SharpCompress.Common;
-using SharpCompress.Common.Zip;
-using SharpCompress.Common.Zip.Headers;
-using SharpCompress.Compressor.Deflate;
-using SharpCompress.Reader;
-using SharpCompress.Reader.Zip;
-using SharpCompress.Writer.Zip;
-
-namespace SharpCompress.Archive.Zip
-{
- internal class ZipArchive : AbstractWritableArchive<ZipArchiveEntry, ZipVolume>
- {
- private readonly SeekableZipHeaderFactory headerFactory;
-
- /// <summary>
- /// Gets or sets the compression level applied to files added to the archive,
- /// if the compression method is set to deflate
- /// </summary>
- public CompressionLevel DeflateCompressionLevel { get; set; }
-
-#if !PORTABLE && !NETFX_CORE
- /// <summary>
- /// Constructor expects a filepath to an existing file.
- /// </summary>
- /// <param name="filePath"></param>
- /// <param name="password"></param>
- public static ZipArchive Open(string filePath, string password = null)
- {
- return Open(filePath, Options.None, password);
- }
-
- /// <summary>
- /// Constructor with a FileInfo object to an existing file.
- /// </summary>
- /// <param name="fileInfo"></param>
- /// <param name="password"></param>
- public static ZipArchive Open(FileInfo fileInfo, string password = null)
- {
- return Open(fileInfo, Options.None, password);
- }
-
- /// <summary>
- /// Constructor expects a filepath to an existing file.
- /// </summary>
- /// <param name="filePath"></param>
- /// <param name="options"></param>
- /// <param name="password"></param>
- public static ZipArchive Open(string filePath, Options options, string password = null)
- {
- filePath.CheckNotNullOrEmpty("filePath");
- return Open(new FileInfo(filePath), options, password);
- }
-
- /// <summary>
- /// Constructor with a FileInfo object to an existing file.
- /// </summary>
- /// <param name="fileInfo"></param>
- /// <param name="options"></param>
- /// <param name="password"></param>
- public static ZipArchive Open(FileInfo fileInfo, Options options, string password = null)
- {
- fileInfo.CheckNotNull("fileInfo");
- return new ZipArchive(fileInfo, options, password);
- }
-#endif
-
- /// <summary>
- /// Takes a seekable Stream as a source
- /// </summary>
- /// <param name="stream"></param>
- /// <param name="password"></param>
- public static ZipArchive Open(Stream stream, string password = null)
- {
- stream.CheckNotNull("stream");
- return Open(stream, Options.None, password);
- }
-
- /// <summary>
- /// Takes a seekable Stream as a source
- /// </summary>
- /// <param name="stream"></param>
- /// <param name="options"></param>
- /// <param name="password"></param>
- public static ZipArchive Open(Stream stream, Options options, string password = null)
- {
- stream.CheckNotNull("stream");
- return new ZipArchive(stream, options, password);
- }
-
-#if !PORTABLE && !NETFX_CORE
- public static bool IsZipFile(string filePath, string password = null)
- {
- return IsZipFile(new FileInfo(filePath), password);
- }
-
- public static bool IsZipFile(FileInfo fileInfo, string password = null)
- {
- if (!fileInfo.Exists)
- {
- return false;
- }
- using (Stream stream = fileInfo.OpenRead())
- {
- return IsZipFile(stream, password);
- }
- }
-#endif
-
- public static bool IsZipFile(Stream stream, string password = null)
- {
- StreamingZipHeaderFactory headerFactory = new StreamingZipHeaderFactory(password);
- try
- {
- ZipHeader header =
- headerFactory.ReadStreamHeader(stream).FirstOrDefault(x => x.ZipHeaderType != ZipHeaderType.Split);
- if (header == null)
- {
- return false;
- }
- return Enum.IsDefined(typeof (ZipHeaderType), header.ZipHeaderType);
- }
- catch (CryptographicException)
- {
- return true;
- }
- catch
- {
- return false;
- }
- }
-
-#if !PORTABLE && !NETFX_CORE
- /// <summary>
- /// Constructor with a FileInfo object to an existing file.
- /// </summary>
- /// <param name="fileInfo"></param>
- /// <param name="options"></param>
- /// <param name="password"></param>
- internal ZipArchive(FileInfo fileInfo, Options options, string password = null)
- : base(ArchiveType.Zip, fileInfo, options)
- {
- headerFactory = new SeekableZipHeaderFactory(password);
- }
-
- protected override IEnumerable<ZipVolume> LoadVolumes(FileInfo file, Options options)
- {
- if (FlagUtility.HasFlag(options, Options.KeepStreamsOpen))
- {
- options = (Options)FlagUtility.SetFlag(options, Options.KeepStreamsOpen, false);
- }
- return new ZipVolume(file.OpenRead(), options).AsEnumerable();
- }
-#endif
-
- internal ZipArchive()
- : base(ArchiveType.Zip)
- {
- }
-
- /// <summary>
- /// Takes multiple seekable Streams for a multi-part archive
- /// </summary>
- /// <param name="stream"></param>
- /// <param name="options"></param>
- /// <param name="password"></param>
- internal ZipArchive(Stream stream, Options options, string password = null)
- : base(ArchiveType.Zip, stream, options)
- {
- headerFactory = new SeekableZipHeaderFactory(password);
- }
-
- protected override IEnumerable<ZipVolume> LoadVolumes(IEnumerable<Stream> streams, Options options)
- {
- return new ZipVolume(streams.First(), options).AsEnumerable();
- }
-
- protected override IEnumerable<ZipArchiveEntry> LoadEntries(IEnumerable<ZipVolume> volumes)
- {
- var volume = volumes.Single();
- Stream stream = volume.Stream;
- foreach (ZipHeader h in headerFactory.ReadSeekableHeader(stream))
- {
- if (h != null)
- {
- switch (h.ZipHeaderType)
- {
- case ZipHeaderType.DirectoryEntry:
- {
- yield return new ZipArchiveEntry(this,
- new SeekableZipFilePart(headerFactory,
- h as DirectoryEntryHeader,
- stream));
- }
- break;
- case ZipHeaderType.DirectoryEnd:
- {
- byte[] bytes = (h as DirectoryEndHeader).Comment;
- volume.Comment = ArchiveEncoding.Default.GetString(bytes, 0, bytes.Length);
- yield break;
- }
- }
- }
- }
- }
-
- protected override void SaveTo(Stream stream, CompressionInfo compressionInfo, Encoding encoding,
- IEnumerable<ZipArchiveEntry> oldEntries,
- IEnumerable<ZipArchiveEntry> newEntries)
- {
- using (var writer = new ZipWriter(stream, compressionInfo, string.Empty, encoding))
- {
- foreach (var entry in oldEntries.Concat(newEntries)
- .Where(x => !x.IsDirectory))
- {
- using (var entryStream = entry.OpenEntryStream())
- {
- writer.Write(entry.Key, entryStream, entry.LastModifiedTime, string.Empty);
- }
- }
- }
- }
-
- protected override ZipArchiveEntry CreateEntryInternal(string filePath, Stream source, long size, DateTime? modified,
- bool closeStream)
- {
- return new ZipWritableArchiveEntry(this, source, filePath, size, modified, closeStream);
- }
-
- public static ZipArchive Create()
- {
- return new ZipArchive();
- }
-
- protected override IReader CreateReaderForSolidExtraction()
- {
- var stream = Volumes.Single().Stream;
- stream.Position = 0;
- return ZipReader.Open(stream);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-using System.Linq;
-using SharpCompress.Common.Zip;
-
-namespace SharpCompress.Archive.Zip
-{
- internal class ZipArchiveEntry : ZipEntry, IArchiveEntry
- {
- internal ZipArchiveEntry(ZipArchive archive, SeekableZipFilePart part)
- : base(part)
- {
- Archive = archive;
- }
-
- public virtual Stream OpenEntryStream()
- {
- return Parts.Single().GetCompressedStream();
- }
-
- #region IArchiveEntry Members
-
- public IArchive Archive { get; private set; }
-
- public bool IsComplete
- {
- get { return true; }
- }
-
- #endregion
-
- public string Comment
- {
- get { return (Parts.Single() as SeekableZipFilePart).Comment; }
- }
-
- public override string ToString()
- {
- return this.Key;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.IO;
-using SharpCompress.Common;
-using SharpCompress.IO;
-
-namespace SharpCompress.Archive.Zip
-{
- internal class ZipWritableArchiveEntry : ZipArchiveEntry, IWritableArchiveEntry
- {
- private readonly string path;
- private readonly long size;
- private readonly bool closeStream;
- private readonly Stream stream;
- private bool isDisposed;
-
- internal ZipWritableArchiveEntry(ZipArchive archive, Stream stream, string path, long size,
- DateTime? lastModified, bool closeStream)
- : base(archive, null)
- {
- this.stream = stream;
- this.path = path;
- this.size = size;
- this.LastModifiedTime = lastModified;
- this.closeStream = closeStream;
- }
-
- public override uint Crc
- {
- get { return 0; }
- }
-
- public override string Key
- {
- get { return path; }
- }
-
- public override long CompressedSize
- {
- get { return 0; }
- }
-
- public override long Size
- {
- get { return size; }
- }
-
- public override DateTime? CreatedTime
- {
- get { return null; }
- }
-
- public override DateTime? LastAccessedTime
- {
- get { return null; }
- }
-
- public override DateTime? ArchivedTime
- {
- get { return null; }
- }
-
- public override bool IsEncrypted
- {
- get { return false; }
- }
-
- public override bool IsDirectory
- {
- get { return false; }
- }
-
- public override bool IsSplit
- {
- get { return false; }
- }
-
- internal override IEnumerable<FilePart> Parts
- {
- get { throw new NotImplementedException(); }
- }
-
- Stream IWritableArchiveEntry.Stream
- {
- get
- {
- return stream;
- }
- }
-
- public override Stream OpenEntryStream()
- {
- //ensure new stream is at the start, this could be reset
- stream.Seek(0, SeekOrigin.Begin);
- return new NonDisposingStream(stream);
- }
-
- internal override void Close()
- {
- if (closeStream && !isDisposed)
- {
- stream.Dispose();
- isDisposed = true;
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Globalization;
-using System.Text;
-
-namespace SharpCompress.Common
-{
- internal class ArchiveEncoding
- {
- /// <summary>
- /// Default encoding to use when archive format doesn't specify one.
- /// </summary>
- public static Encoding Default;
-
- /// <summary>
- /// Encoding used by encryption schemes which don't comply with RFC 2898.
- /// </summary>
- public static Encoding Password;
-
- static ArchiveEncoding()
- {
-#if PORTABLE || NETFX_CORE
- Default = Encoding.UTF8;
- Password = Encoding.UTF8;
-#else
- Default = Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.OEMCodePage);
- Password = Encoding.Default;
-#endif
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- internal class ArchiveException : Exception
- {
- public ArchiveException(string message)
- : base(message)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- internal class ArchiveExtractionEventArgs<T> : EventArgs
- {
- internal ArchiveExtractionEventArgs(T entry)
- {
- Item = entry;
- }
-
- public T Item { get; private set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace SharpCompress.Common
-{
- internal enum ArchiveType
- {
- Rar,
- Zip,
- Tar,
- SevenZip,
- GZip,
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- internal class CompressedBytesReadEventArgs : EventArgs
- {
- /// <summary>
- /// Compressed bytes read for the current entry
- /// </summary>
- public long CompressedBytesRead { get; internal set; }
-
- /// <summary>
- /// Current file part read for Multipart files (e.g. Rar)
- /// </summary>
- public long CurrentFilePartCompressedBytesRead { get; internal set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using SharpCompress.Compressor.Deflate;
-
-namespace SharpCompress.Common
-{
- /// <summary>
- /// Detailed compression properties when saving.
- /// </summary>
- internal class CompressionInfo
- {
- public CompressionInfo()
- {
- DeflateCompressionLevel = CompressionLevel.Default;
- }
-
- /// <summary>
- /// The algorthm to use. Must be valid for the format type.
- /// </summary>
- public CompressionType Type { get; set; }
-
- /// <summary>
- /// When CompressionType.Deflate is used, this property is referenced. Defaults to CompressionLevel.Default.
- /// </summary>
- public CompressionLevel DeflateCompressionLevel { get; set; }
-
- public static implicit operator CompressionInfo(CompressionType compressionType)
- {
- return new CompressionInfo() {Type = compressionType};
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace SharpCompress.Common
-{
- internal enum CompressionType
- {
- None,
- GZip,
- BZip2,
- PPMd,
- Deflate,
- Rar,
- LZMA,
- BCJ,
- BCJ2,
- Unknown,
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- internal class CryptographicException : Exception
- {
- public CryptographicException(string message)
- : base(message)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-
-namespace SharpCompress.Common
-{
- internal abstract class Entry : IEntry
- {
- /// <summary>
- /// The File's 32 bit CRC Hash
- /// </summary>
- public abstract uint Crc { get; }
-
- /// <summary>
- /// The string key of the file internal to the Archive.
- /// </summary>
- public abstract string Key { get; }
-
- /// <summary>
- /// The compressed file size
- /// </summary>
- public abstract long CompressedSize { get; }
-
- /// <summary>
- /// The compression type
- /// </summary>
- public abstract CompressionType CompressionType { get; }
-
- /// <summary>
- /// The uncompressed file size
- /// </summary>
- public abstract long Size { get; }
-
- /// <summary>
- /// The entry last modified time in the archive, if recorded
- /// </summary>
- public abstract DateTime? LastModifiedTime { get; set; }
-
- /// <summary>
- /// The entry create time in the archive, if recorded
- /// </summary>
- public abstract DateTime? CreatedTime { get; }
-
- /// <summary>
- /// The entry last accessed time in the archive, if recorded
- /// </summary>
- public abstract DateTime? LastAccessedTime { get; }
-
- /// <summary>
- /// The entry time whend archived, if recorded
- /// </summary>
- public abstract DateTime? ArchivedTime { get; }
-
- /// <summary>
- /// Entry is password protected and encrypted and cannot be extracted.
- /// </summary>
- public abstract bool IsEncrypted { get; }
-
- /// <summary>
- /// Entry is password protected and encrypted and cannot be extracted.
- /// </summary>
- public abstract bool IsDirectory { get; }
-
- /// <summary>
- /// Entry is split among multiple volumes
- /// </summary>
- public abstract bool IsSplit { get; }
-
- internal abstract IEnumerable<FilePart> Parts { get; }
- internal bool IsSolid { get; set; }
-
- internal virtual void Close()
- {
-
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-
-namespace SharpCompress.Common
-{
- internal class EntryStream : Stream
- {
- private Stream stream;
- private bool completed;
- private bool isDisposed;
-
- internal EntryStream(Stream stream)
- {
- this.stream = stream;
- }
-
- /// <summary>
- /// When reading a stream from OpenEntryStream, the stream must be completed so use this to finish reading the entire entry.
- /// </summary>
- public void SkipEntry()
- {
- var buffer = new byte[4096];
- while (Read(buffer, 0, buffer.Length) > 0)
- {
- }
- completed = true;
- }
-
- protected override void Dispose(bool disposing)
- {
- if (!completed)
- {
- throw new InvalidOperationException(
- "EntryStream has not been fully consumed. Read the entire stream or use SkipEntry.");
- }
- if (isDisposed)
- {
- return;
- }
- isDisposed = true;
- base.Dispose(disposing);
- stream.Dispose();
- }
-
- public override bool CanRead
- {
- get { return true; }
- }
-
- public override bool CanSeek
- {
- get { return false; }
- }
-
- public override bool CanWrite
- {
- get { return false; }
- }
-
- public override void Flush()
- {
- throw new System.NotImplementedException();
- }
-
- public override long Length
- {
- get { throw new System.NotImplementedException(); }
- }
-
- public override long Position
- {
- get { throw new System.NotImplementedException(); }
- set { throw new System.NotImplementedException(); }
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- int read = stream.Read(buffer, offset, count);
- if (read <= 0)
- {
- completed = true;
- }
- return read;
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new System.NotImplementedException();
- }
-
- public override void SetLength(long value)
- {
- throw new System.NotImplementedException();
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- throw new System.NotImplementedException();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- [Flags]
- internal enum ExtractOptions
- {
- None,
-
- /// <summary>
- /// overwrite target if it exists
- /// </summary>
- Overwrite,
-
- /// <summary>
- /// extract with internal directory structure
- /// </summary>
- ExtractFullPath,
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- internal class ExtractionException : Exception
- {
- public ExtractionException(string message)
- : base(message)
- {
- }
-
- public ExtractionException(string message, Exception inner)
- : base(message, inner)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-
-namespace SharpCompress.Common
-{
- internal abstract class FilePart
- {
- internal abstract string FilePartName { get; }
-
- internal abstract Stream GetCompressedStream();
- internal abstract Stream GetRawStream();
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- internal class FilePartExtractionBeginEventArgs : EventArgs
- {
- /// <summary>
- /// File name for the part for the current entry
- /// </summary>
- public string Name { get; internal set; }
-
- /// <summary>
- /// Uncompressed size of the current entry in the part
- /// </summary>
- public long Size { get; internal set; }
-
- /// <summary>
- /// Compressed size of the current entry in the part
- /// </summary>
- public long CompressedSize { get; internal set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- internal static class FlagUtility
- {
- /// <summary>
- /// Returns true if the flag is set on the specified bit field.
- /// Currently only works with 32-bit bitfields.
- /// </summary>
- /// <typeparam name="T">Enumeration with Flags attribute</typeparam>
- /// <param name="bitField">Flagged variable</param>
- /// <param name="flag">Flag to test</param>
- /// <returns></returns>
- public static bool HasFlag<T>(long bitField, T flag)
- where T : struct
- {
- return HasFlag(bitField, flag);
- }
-
- /// <summary>
- /// Returns true if the flag is set on the specified bit field.
- /// Currently only works with 32-bit bitfields.
- /// </summary>
- /// <typeparam name="T">Enumeration with Flags attribute</typeparam>
- /// <param name="bitField">Flagged variable</param>
- /// <param name="flag">Flag to test</param>
- /// <returns></returns>
- public static bool HasFlag<T>(ulong bitField, T flag)
- where T : struct
- {
- return HasFlag(bitField, flag);
- }
-
- /// <summary>
- /// Returns true if the flag is set on the specified bit field.
- /// Currently only works with 32-bit bitfields.
- /// </summary>
- /// <param name="bitField">Flagged variable</param>
- /// <param name="flag">Flag to test</param>
- /// <returns></returns>
- public static bool HasFlag(ulong bitField, ulong flag)
- {
- return ((bitField & flag) == flag);
- }
-
- public static bool HasFlag(short bitField, short flag)
- {
- return ((bitField & flag) == flag);
- }
-
-#if PORTABLE
- /// <summary>
- /// Generically checks enums in a Windows Phone 7 enivronment
- /// </summary>
- /// <param name="enumVal"></param>
- /// <param name="flag"></param>
- /// <returns></returns>
- public static bool HasFlag(this Enum enumVal, Enum flag)
- {
- if (enumVal.GetHashCode() > 0) //GetHashCode returns the enum value. But it's something very crazy if not set beforehand
- {
- ulong num = Convert.ToUInt64(flag.GetHashCode());
- return ((Convert.ToUInt64(enumVal.GetHashCode()) & num) == num);
- }
- else
- {
- return false;
- }
- }
-#endif
-
- /// <summary>
- /// Returns true if the flag is set on the specified bit field.
- /// Currently only works with 32-bit bitfields.
- /// </summary>
- /// <typeparam name="T">Enumeration with Flags attribute</typeparam>
- /// <param name="bitField">Flagged variable</param>
- /// <param name="flag">Flag to test</param>
- /// <returns></returns>
- public static bool HasFlag<T>(T bitField, T flag)
- where T : struct
- {
- return HasFlag(Convert.ToInt64(bitField), Convert.ToInt64(flag));
- }
-
- /// <summary>
- /// Returns true if the flag is set on the specified bit field.
- /// Currently only works with 32-bit bitfields.
- /// </summary>
- /// <param name="bitField">Flagged variable</param>
- /// <param name="flag">Flag to test</param>
- /// <returns></returns>
- public static bool HasFlag(long bitField, long flag)
- {
- return ((bitField & flag) == flag);
- }
-
-
- /// <summary>
- /// Sets a bit-field to either on or off for the specified flag.
- /// </summary>
- /// <param name="bitField">Flagged variable</param>
- /// <param name="flag">Flag to change</param>
- /// <param name="on">bool</param>
- /// <returns>The flagged variable with the flag changed</returns>
- public static long SetFlag(long bitField, long flag, bool @on)
- {
- if (@on)
- {
- return bitField | flag;
- }
- return bitField & (~flag);
- }
-
- /// <summary>
- /// Sets a bit-field to either on or off for the specified flag.
- /// </summary>
- /// <typeparam name="T">Enumeration with Flags attribute</typeparam>
- /// <param name="bitField">Flagged variable</param>
- /// <param name="flag">Flag to change</param>
- /// <param name="on">bool</param>
- /// <returns>The flagged variable with the flag changed</returns>
- public static long SetFlag<T>(T bitField, T flag, bool @on)
- where T : struct
- {
- return SetFlag(Convert.ToInt64(bitField), Convert.ToInt64(flag), @on);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- internal interface IEntry
- {
- CompressionType CompressionType { get; }
- DateTime? ArchivedTime { get; }
- long CompressedSize { get; }
- uint Crc { get; }
- DateTime? CreatedTime { get; }
- string Key { get; }
- bool IsDirectory { get; }
- bool IsEncrypted { get; }
- bool IsSplit { get; }
- DateTime? LastAccessedTime { get; }
- DateTime? LastModifiedTime { get; set; }
- long Size { get; }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace SharpCompress.Common
-{
- internal interface IExtractionListener
- {
- void FireFilePartExtractionBegin(string name, long size, long compressedSize);
- void FireCompressedBytesRead(long currentPartCompressedBytes, long compressedReadBytes);
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-#if !PORTABLE && !NETFX_CORE
-using System.IO;
-#endif
-
-namespace SharpCompress.Common
-{
- internal interface IVolume : IDisposable
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace SharpCompress.Common
-{
- internal class IncompleteArchiveException : ArchiveException
- {
- public IncompleteArchiveException(string message)
- : base(message)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- internal class InvalidFormatException : ExtractionException
- {
- public InvalidFormatException(string message)
- : base(message)
- {
- }
-
- public InvalidFormatException(string message, Exception inner)
- : base(message, inner)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- internal class MultiVolumeExtractionException : ExtractionException
- {
- public MultiVolumeExtractionException(string message)
- : base(message)
- {
- }
-
- public MultiVolumeExtractionException(string message, Exception inner)
- : base(message, inner)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace SharpCompress.Common
-{
- internal class MultipartStreamRequiredException : ExtractionException
- {
- public MultipartStreamRequiredException(string message)
- : base(message)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- [Flags]
- internal enum Options
- {
- /// <summary>
- /// No options specified
- /// </summary>
- None = 0,
-
- /// <summary>
- /// SharpCompress will keep the supplied streams open
- /// </summary>
- KeepStreamsOpen = 1,
-
- /// <summary>
- /// Look for RarArchive (Check for self-extracting archives or cases where RarArchive isn't at the start of the file)
- /// </summary>
- LookForHeader = 2,
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common
-{
- internal class PasswordProtectedException : ExtractionException
- {
- public PasswordProtectedException(string message)
- : base(message)
- {
- }
-
- public PasswordProtectedException(string message, Exception inner)
- : base(message, inner)
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-using SharpCompress.IO;
-
-namespace SharpCompress.Common
-{
- internal abstract class Volume : IVolume
- {
- private readonly Stream actualStream;
-
- internal Volume(Stream stream, Options options)
- {
- actualStream = stream;
- Options = options;
- }
-
- internal Stream Stream
- {
- get { return new NonDisposingStream(actualStream); }
- }
-
- internal Options Options { get; private set; }
-
- /// <summary>
- /// RarArchive is the first volume of a multi-part archive.
- /// Only Rar 3.0 format and higher
- /// </summary>
- public virtual bool IsFirstVolume
- {
- get { return true; }
- }
-
- /// <summary>
- /// RarArchive is part of a multi-part archive.
- /// </summary>
- public virtual bool IsMultiVolume
- {
- get { return true; }
- }
-
- private bool disposed;
-
- public void Dispose()
- {
- if (!Options.HasFlag(Options.KeepStreamsOpen) && !disposed)
- {
- actualStream.Dispose();
- disposed = true;
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-
-namespace SharpCompress.Common.Zip.Headers
-{
- internal class DirectoryEndHeader : ZipHeader
- {
- public DirectoryEndHeader()
- : base(ZipHeaderType.DirectoryEnd)
- {
- }
-
- internal override void Read(BinaryReader reader)
- {
- VolumeNumber = reader.ReadUInt16();
- FirstVolumeWithDirectory = reader.ReadUInt16();
- TotalNumberOfEntriesInDisk = reader.ReadUInt16();
- TotalNumberOfEntries = reader.ReadUInt16();
- DirectorySize = reader.ReadUInt32();
- DirectoryStartOffsetRelativeToDisk = reader.ReadUInt32();
- CommentLength = reader.ReadUInt16();
- Comment = reader.ReadBytes(CommentLength);
- }
-
- internal override void Write(BinaryWriter writer)
- {
- writer.Write(VolumeNumber);
- writer.Write(FirstVolumeWithDirectory);
- writer.Write(TotalNumberOfEntriesInDisk);
- writer.Write(TotalNumberOfEntries);
- writer.Write(DirectorySize);
- writer.Write(DirectoryStartOffsetRelativeToDisk);
- writer.Write(CommentLength);
- writer.Write(Comment);
- }
-
- public ushort VolumeNumber { get; private set; }
-
- public ushort FirstVolumeWithDirectory { get; private set; }
-
- public ushort TotalNumberOfEntriesInDisk { get; private set; }
-
- public uint DirectorySize { get; private set; }
-
- public uint DirectoryStartOffsetRelativeToDisk { get; private set; }
-
- public ushort CommentLength { get; private set; }
-
- public byte[] Comment { get; private set; }
-
- public ushort TotalNumberOfEntries { get; private set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-
-namespace SharpCompress.Common.Zip.Headers
-{
- internal class DirectoryEntryHeader : ZipFileEntry
- {
- public DirectoryEntryHeader()
- : base(ZipHeaderType.DirectoryEntry)
- {
- }
-
- internal override void Read(BinaryReader reader)
- {
- Version = reader.ReadUInt16();
- VersionNeededToExtract = reader.ReadUInt16();
- Flags = (HeaderFlags) reader.ReadUInt16();
- CompressionMethod = (ZipCompressionMethod) reader.ReadUInt16();
- LastModifiedTime = reader.ReadUInt16();
- LastModifiedDate = reader.ReadUInt16();
- Crc = reader.ReadUInt32();
- CompressedSize = reader.ReadUInt32();
- UncompressedSize = reader.ReadUInt32();
- ushort nameLength = reader.ReadUInt16();
- ushort extraLength = reader.ReadUInt16();
- ushort commentLength = reader.ReadUInt16();
- DiskNumberStart = reader.ReadUInt16();
- InternalFileAttributes = reader.ReadUInt16();
- ExternalFileAttributes = reader.ReadUInt32();
- RelativeOffsetOfEntryHeader = reader.ReadUInt32();
-
- byte[] name = reader.ReadBytes(nameLength);
- Name = DecodeString(name);
- byte[] extra = reader.ReadBytes(extraLength);
- byte[] comment = reader.ReadBytes(commentLength);
- Comment = DecodeString(comment);
- LoadExtra(extra);
- }
-
- internal override void Write(BinaryWriter writer)
- {
- writer.Write(Version);
- writer.Write(VersionNeededToExtract);
- writer.Write((ushort) Flags);
- writer.Write((ushort) CompressionMethod);
- writer.Write(LastModifiedTime);
- writer.Write(LastModifiedDate);
- writer.Write(Crc);
- writer.Write(CompressedSize);
- writer.Write(UncompressedSize);
-
- byte[] nameBytes = EncodeString(Name);
- writer.Write((ushort) nameBytes.Length);
- //writer.Write((ushort)Extra.Length);
- writer.Write((ushort) 0);
- writer.Write((ushort) Comment.Length);
-
- writer.Write(DiskNumberStart);
- writer.Write(InternalFileAttributes);
- writer.Write(ExternalFileAttributes);
- writer.Write(RelativeOffsetOfEntryHeader);
-
- writer.Write(nameBytes);
- // writer.Write(Extra);
- writer.Write(Comment);
- }
-
- internal ushort Version { get; private set; }
-
- public ushort VersionNeededToExtract { get; set; }
-
- public uint RelativeOffsetOfEntryHeader { get; set; }
-
- public uint ExternalFileAttributes { get; set; }
-
- public ushort InternalFileAttributes { get; set; }
-
- public ushort DiskNumberStart { get; set; }
-
- public string Comment { get; private set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common.Zip.Headers
-{
- [Flags]
- internal enum HeaderFlags : ushort
- {
- Encrypted = 1, // http://www.pkware.com/documents/casestudies/APPNOTE.TXT
- Bit1 = 2,
- Bit2 = 4,
- UsePostDataDescriptor = 8,
- EnhancedDeflate = 16,
- UTF8 = 2048
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-
-namespace SharpCompress.Common.Zip.Headers
-{
- internal class IgnoreHeader : ZipHeader
- {
- public IgnoreHeader(ZipHeaderType type)
- : base(type)
- {
- }
-
- internal override void Read(BinaryReader reader)
- {
- }
-
- internal override void Write(BinaryWriter writer)
- {
- throw new NotImplementedException();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-
-namespace SharpCompress.Common.Zip.Headers
-{
- internal enum ExtraDataType : ushort
- {
- WinZipAes = 0x9901,
- }
-
- internal class ExtraData
- {
- internal ExtraDataType Type { get; set; }
- internal ushort Length { get; set; }
- internal byte[] DataBytes { get; set; }
- }
-
- internal class LocalEntryHeader : ZipFileEntry
- {
- public LocalEntryHeader()
- : base(ZipHeaderType.LocalEntry)
- {
- }
-
- internal override void Read(BinaryReader reader)
- {
- Version = reader.ReadUInt16();
- Flags = (HeaderFlags) reader.ReadUInt16();
- CompressionMethod = (ZipCompressionMethod) reader.ReadUInt16();
- LastModifiedTime = reader.ReadUInt16();
- LastModifiedDate = reader.ReadUInt16();
- Crc = reader.ReadUInt32();
- CompressedSize = reader.ReadUInt32();
- UncompressedSize = reader.ReadUInt32();
- ushort nameLength = reader.ReadUInt16();
- ushort extraLength = reader.ReadUInt16();
- byte[] name = reader.ReadBytes(nameLength);
- byte[] extra = reader.ReadBytes(extraLength);
- Name = DecodeString(name);
- LoadExtra(extra);
- }
-
- internal override void Write(BinaryWriter writer)
- {
- writer.Write(Version);
- writer.Write((ushort) Flags);
- writer.Write((ushort) CompressionMethod);
- writer.Write(LastModifiedTime);
- writer.Write(LastModifiedDate);
- writer.Write(Crc);
- writer.Write(CompressedSize);
- writer.Write(UncompressedSize);
-
- byte[] nameBytes = EncodeString(Name);
-
- writer.Write((ushort) nameBytes.Length);
- writer.Write((ushort) 0);
- //if (Extra != null)
- //{
- // writer.Write(Extra);
- //}
- writer.Write(nameBytes);
- }
-
- internal ushort Version { get; private set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common.Zip.Headers
-{
- internal class SplitHeader : ZipHeader
- {
- public SplitHeader()
- : base(ZipHeaderType.Split)
- {
- }
-
- internal override void Read(System.IO.BinaryReader reader)
- {
- throw new NotImplementedException();
- }
-
- internal override void Write(System.IO.BinaryWriter writer)
- {
- throw new NotImplementedException();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-
-namespace SharpCompress.Common.Zip.Headers
-{
- internal abstract class ZipFileEntry : ZipHeader
- {
- protected ZipFileEntry(ZipHeaderType type)
- : base(type)
- {
- Extra = new List<ExtraData>();
- }
-
-
- internal bool IsDirectory
- {
- get { return Name.EndsWith("/"); }
- }
-
- protected string DecodeString(byte[] str)
- {
- if (FlagUtility.HasFlag(Flags, HeaderFlags.UTF8))
- {
- return Encoding.UTF8.GetString(str, 0, str.Length);
- }
- return ArchiveEncoding.Default.GetString(str, 0, str.Length);
- }
-
- protected byte[] EncodeString(string str)
- {
- if (FlagUtility.HasFlag(Flags, HeaderFlags.UTF8))
- {
- return Encoding.UTF8.GetBytes(str);
- }
- return ArchiveEncoding.Default.GetBytes(str);
- }
-
- internal Stream PackedStream { get; set; }
-
- internal string Name { get; set; }
-
- internal HeaderFlags Flags { get; set; }
-
- internal ZipCompressionMethod CompressionMethod { get; set; }
-
- internal uint CompressedSize { get; set; }
-
- internal long? DataStartPosition { get; set; }
-
- internal uint UncompressedSize { get; set; }
-
- internal List<ExtraData> Extra { get; set; }
-
- internal PkwareTraditionalEncryptionData PkwareTraditionalEncryptionData { get; set; }
-#if !PORTABLE && !NETFX_CORE
- internal WinzipAesEncryptionData WinzipAesEncryptionData { get; set; }
-#endif
-
- internal ushort LastModifiedDate { get; set; }
-
- internal ushort LastModifiedTime { get; set; }
-
- internal uint Crc { get; set; }
-
- protected void LoadExtra(byte[] extra)
- {
- if (extra.Length % 2 != 0)
- return;
-
- for (int i = 0; i < extra.Length;)
- {
- ExtraDataType type = (ExtraDataType) BitConverter.ToUInt16(extra, i);
- if (!Enum.IsDefined(typeof (ExtraDataType), type))
- {
- return;
- }
- ushort length = BitConverter.ToUInt16(extra, i + 2);
- byte[] data = new byte[length];
- Buffer.BlockCopy(extra, i + 4, data, 0, length);
- Extra.Add(new ExtraData
- {
- Type = type,
- Length = length,
- DataBytes = data
- });
- i += length + 4;
- }
- }
-
- internal ZipFilePart Part { get; set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-
-namespace SharpCompress.Common.Zip.Headers
-{
- internal abstract class ZipHeader
- {
- protected ZipHeader(ZipHeaderType type)
- {
- ZipHeaderType = type;
- HasData = true;
- }
-
- internal ZipHeaderType ZipHeaderType { get; private set; }
-
- internal abstract void Read(BinaryReader reader);
-
- internal abstract void Write(BinaryWriter writer);
-
- internal bool HasData { get; set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace SharpCompress.Common.Zip.Headers
-{
- internal enum ZipHeaderType
- {
- Ignore,
- LocalEntry,
- DirectoryEntry,
- DirectoryEnd,
- Split,
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-
-namespace SharpCompress.Common.Zip
-{
- internal enum CryptoMode
- {
- Encrypt,
- Decrypt
- }
-
-
- internal class PkwareTraditionalCryptoStream : Stream
- {
- private readonly PkwareTraditionalEncryptionData encryptor;
- private readonly CryptoMode mode;
- private readonly Stream stream;
- private bool isDisposed;
-
- public PkwareTraditionalCryptoStream(Stream stream, PkwareTraditionalEncryptionData encryptor, CryptoMode mode)
- {
- this.encryptor = encryptor;
- this.stream = stream;
- this.mode = mode;
- }
-
-
- public override bool CanRead
- {
- get { return (mode == CryptoMode.Decrypt); }
- }
-
- public override bool CanSeek
- {
- get { return false; }
- }
-
- public override bool CanWrite
- {
- get { return (mode == CryptoMode.Encrypt); }
- }
-
- public override long Length
- {
- get { throw new NotSupportedException(); }
- }
-
- public override long Position
- {
- get { throw new NotSupportedException(); }
- set { throw new NotSupportedException(); }
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- if (mode == CryptoMode.Encrypt)
- throw new NotSupportedException("This stream does not encrypt via Read()");
-
- if (buffer == null)
- throw new ArgumentNullException("buffer");
-
- byte[] temp = new byte[count];
- int readBytes = stream.Read(temp, 0, count);
- byte[] decrypted = encryptor.Decrypt(temp, readBytes);
- Buffer.BlockCopy(decrypted, 0, buffer, offset, readBytes);
- return readBytes;
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- if (mode == CryptoMode.Decrypt)
- throw new NotSupportedException("This stream does not Decrypt via Write()");
-
- if (count == 0)
- {
- return;
- }
-
- byte[] plaintext = null;
- if (offset != 0)
- {
- plaintext = new byte[count];
- Buffer.BlockCopy(buffer, offset, plaintext, 0, count);
- }
- else
- {
- plaintext = buffer;
- }
-
- byte[] encrypted = encryptor.Encrypt(plaintext, count);
- stream.Write(encrypted, 0, encrypted.Length);
- }
-
- public override void Flush()
- {
- //throw new NotSupportedException();
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new NotSupportedException();
- }
-
- public override void SetLength(long value)
- {
- throw new NotSupportedException();
- }
-
- protected override void Dispose(bool disposing)
- {
- if (isDisposed)
- {
- return;
- }
- isDisposed = true;
- base.Dispose(disposing);
- stream.Dispose();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Text;
-using SharpCompress.Common.Zip.Headers;
-using SharpCompress.Compressor.Deflate;
-
-namespace SharpCompress.Common.Zip
-{
- internal class PkwareTraditionalEncryptionData
- {
- private static readonly CRC32 crc32 = new CRC32();
- private readonly UInt32[] _Keys = {0x12345678, 0x23456789, 0x34567890};
-
- private PkwareTraditionalEncryptionData(string password)
- {
- Initialize(password);
- }
-
- private byte MagicByte
- {
- get
- {
- ushort t = (ushort) ((ushort) (_Keys[2] & 0xFFFF) | 2);
- return (byte) ((t*(t ^ 1)) >> 8);
- }
- }
-
- public static PkwareTraditionalEncryptionData ForRead(string password, ZipFileEntry header,
- byte[] encryptionHeader)
- {
- var encryptor = new PkwareTraditionalEncryptionData(password);
- byte[] plainTextHeader = encryptor.Decrypt(encryptionHeader, encryptionHeader.Length);
- if (plainTextHeader[11] != (byte) ((header.Crc >> 24) & 0xff))
- {
- if (!FlagUtility.HasFlag(header.Flags, HeaderFlags.UsePostDataDescriptor))
- {
- throw new CryptographicException("The password did not match.");
- }
- if (plainTextHeader[11] != (byte) ((header.LastModifiedTime >> 8) & 0xff))
- {
- throw new CryptographicException("The password did not match.");
- }
- }
- return encryptor;
- }
-
-
- public byte[] Decrypt(byte[] cipherText, int length)
- {
- if (length > cipherText.Length)
- throw new ArgumentOutOfRangeException("length",
- "Bad length during Decryption: the length parameter must be smaller than or equal to the size of the destination array.");
-
- var plainText = new byte[length];
- for (int i = 0; i < length; i++)
- {
- var C = (byte) (cipherText[i] ^ MagicByte);
- UpdateKeys(C);
- plainText[i] = C;
- }
- return plainText;
- }
-
- public byte[] Encrypt(byte[] plainText, int length)
- {
- if (plainText == null)
- throw new ArgumentNullException("plaintext");
-
- if (length > plainText.Length)
- throw new ArgumentOutOfRangeException("length",
- "Bad length during Encryption: The length parameter must be smaller than or equal to the size of the destination array.");
-
- var cipherText = new byte[length];
- for (int i = 0; i < length; i++)
- {
- byte C = plainText[i];
- cipherText[i] = (byte) (plainText[i] ^ MagicByte);
- UpdateKeys(C);
- }
- return cipherText;
- }
-
- private void Initialize(string password)
- {
- byte[] p = StringToByteArray(password);
- for (int i = 0; i < password.Length; i++)
- UpdateKeys(p[i]);
- }
-
- internal static byte[] StringToByteArray(string value, Encoding encoding)
- {
- byte[] a = encoding.GetBytes(value);
- return a;
- }
-
- internal static byte[] StringToByteArray(string value)
- {
- return StringToByteArray(value, ArchiveEncoding.Password);
- }
-
- private void UpdateKeys(byte byteValue)
- {
- _Keys[0] = (UInt32) crc32.ComputeCrc32((int) _Keys[0], byteValue);
- _Keys[1] = _Keys[1] + (byte) _Keys[0];
- _Keys[1] = _Keys[1]*0x08088405 + 1;
- _Keys[2] = (UInt32) crc32.ComputeCrc32((int) _Keys[2], (byte) (_Keys[1] >> 24));
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-using SharpCompress.Common.Zip.Headers;
-
-namespace SharpCompress.Common.Zip
-{
- internal class SeekableZipFilePart : ZipFilePart
- {
- private bool isLocalHeaderLoaded;
- private readonly SeekableZipHeaderFactory headerFactory;
-
- internal SeekableZipFilePart(SeekableZipHeaderFactory headerFactory, DirectoryEntryHeader header, Stream stream)
- : base(header, stream)
- {
- this.headerFactory = headerFactory;
- }
-
- internal override Stream GetCompressedStream()
- {
- if (!isLocalHeaderLoaded)
- {
- LoadLocalHeader();
- isLocalHeaderLoaded = true;
- }
- return base.GetCompressedStream();
- }
-
- internal string Comment
- {
- get { return (Header as DirectoryEntryHeader).Comment; }
- }
-
- private void LoadLocalHeader()
- {
- bool hasData = Header.HasData;
- Header = headerFactory.GetLocalHeader(BaseStream, Header as DirectoryEntryHeader);
- Header.HasData = hasData;
- }
-
- protected override Stream CreateBaseStream()
- {
- BaseStream.Position = Header.DataStartPosition.Value;
- return BaseStream;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.IO;
-using SharpCompress.Common.Zip.Headers;
-using SharpCompress.IO;
-
-namespace SharpCompress.Common.Zip
-{
- internal class SeekableZipHeaderFactory : ZipHeaderFactory
- {
- private const int MAX_ITERATIONS_FOR_DIRECTORY_HEADER = 1000;
-
- internal SeekableZipHeaderFactory(string password)
- : base(StreamingMode.Seekable, password)
- {
- }
-
- internal IEnumerable<DirectoryEntryHeader> ReadSeekableHeader(Stream stream)
- {
- long offset = 0;
- uint signature;
- BinaryReader reader = new BinaryReader(stream);
-
- int iterationCount = 0;
- do
- {
- if ((stream.Length + offset) - 4 < 0)
- {
- throw new ArchiveException("Failed to locate the Zip Header");
- }
- stream.Seek(offset - 4, SeekOrigin.End);
- signature = reader.ReadUInt32();
- offset--;
- iterationCount++;
- if (iterationCount > MAX_ITERATIONS_FOR_DIRECTORY_HEADER)
- {
- throw new ArchiveException(
- "Could not find Zip file Directory at the end of the file. File may be corrupted.");
- }
- } while (signature != DIRECTORY_END_HEADER_BYTES);
-
- var entry = new DirectoryEndHeader();
- entry.Read(reader);
- stream.Seek(entry.DirectoryStartOffsetRelativeToDisk, SeekOrigin.Begin);
-
- DirectoryEntryHeader directoryEntryHeader = null;
- long position = stream.Position;
- while (true)
- {
- stream.Position = position;
- signature = reader.ReadUInt32();
- directoryEntryHeader = ReadHeader(signature, reader) as DirectoryEntryHeader;
- position = stream.Position;
- if (directoryEntryHeader == null)
- {
- yield break;
- }
- //entry could be zero bytes so we need to know that.
- directoryEntryHeader.HasData = directoryEntryHeader.CompressedSize != 0;
- yield return directoryEntryHeader;
- }
- }
-
- internal LocalEntryHeader GetLocalHeader(Stream stream, DirectoryEntryHeader directoryEntryHeader)
- {
- stream.Seek(directoryEntryHeader.RelativeOffsetOfEntryHeader, SeekOrigin.Begin);
- BinaryReader reader = new BinaryReader(stream);
- uint signature = reader.ReadUInt32();
- var localEntryHeader = ReadHeader(signature, reader) as LocalEntryHeader;
- if (localEntryHeader == null)
- {
- throw new InvalidOperationException();
- }
- return localEntryHeader;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using System.IO.Compression;
-using SharpCompress.Common.Zip.Headers;
-using SharpCompress.IO;
-
-namespace SharpCompress.Common.Zip
-{
- internal class StreamingZipFilePart : ZipFilePart
- {
- private Stream decompressionStream;
-
- internal StreamingZipFilePart(ZipFileEntry header, Stream stream)
- : base(header, stream)
- {
- }
-
- protected override Stream CreateBaseStream()
- {
- return Header.PackedStream;
- }
-
- internal override Stream GetCompressedStream()
- {
- if (!Header.HasData)
- {
- return Stream.Null;
- }
- decompressionStream = CreateDecompressionStream(GetCryptoStream(CreateBaseStream()));
- if (LeaveStreamOpen)
- {
- return new NonDisposingStream(decompressionStream);
- }
- return decompressionStream;
- }
-
- internal BinaryReader FixStreamedFileLocation(ref RewindableStream rewindableStream)
- {
- if (Header.IsDirectory)
- {
- return new BinaryReader(rewindableStream);
- }
- if (Header.HasData)
- {
- if (decompressionStream == null)
- {
- decompressionStream = GetCompressedStream();
- }
- decompressionStream.SkipAll();
-
- DeflateStream deflateStream = decompressionStream as DeflateStream;
- if (deflateStream != null)
- {
- rewindableStream.Rewind(deflateStream.BaseStream as MemoryStream);
- }
- }
- var reader = new BinaryReader(rewindableStream);
- decompressionStream = null;
- return reader;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Collections.Generic;
-using System.IO;
-using SharpCompress.Common.Zip.Headers;
-using SharpCompress.IO;
-
-namespace SharpCompress.Common.Zip
-{
- internal class StreamingZipHeaderFactory : ZipHeaderFactory
- {
- internal StreamingZipHeaderFactory(string password)
- : base(StreamingMode.Streaming, password)
- {
- }
-
- internal IEnumerable<ZipHeader> ReadStreamHeader(Stream stream)
- {
- RewindableStream rewindableStream;
- if (stream is RewindableStream)
- {
- rewindableStream = stream as RewindableStream;
- }
- else
- {
- rewindableStream = new RewindableStream(stream);
- }
- while (true)
- {
- ZipHeader header = null;
- BinaryReader reader = new BinaryReader(rewindableStream);
- if (lastEntryHeader != null &&
- FlagUtility.HasFlag(lastEntryHeader.Flags, HeaderFlags.UsePostDataDescriptor))
- {
- reader = (lastEntryHeader.Part as StreamingZipFilePart).FixStreamedFileLocation(ref rewindableStream);
- long pos = rewindableStream.Position;
- uint crc = reader.ReadUInt32();
- if (crc == POST_DATA_DESCRIPTOR)
- {
- crc = reader.ReadUInt32();
- }
- lastEntryHeader.Crc = crc;
- lastEntryHeader.CompressedSize = reader.ReadUInt32();
- lastEntryHeader.UncompressedSize = reader.ReadUInt32();
- lastEntryHeader.DataStartPosition = pos - lastEntryHeader.CompressedSize;
- }
- lastEntryHeader = null;
- uint headerBytes = reader.ReadUInt32();
- header = ReadHeader(headerBytes, reader);
-
- //entry could be zero bytes so we need to know that.
- if (header.ZipHeaderType == ZipHeaderType.LocalEntry)
- {
- bool isRecording = rewindableStream.IsRecording;
- if (!isRecording)
- {
- rewindableStream.StartRecording();
- }
- uint nextHeaderBytes = reader.ReadUInt32();
- header.HasData = !IsHeader(nextHeaderBytes);
- rewindableStream.Rewind(!isRecording);
- }
- yield return header;
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using System.Security.Cryptography;
-
-namespace SharpCompress.Common.Zip
-{
- internal class WinzipAesCryptoStream : Stream
- {
- private const int BLOCK_SIZE_IN_BYTES = 16;
- private readonly SymmetricAlgorithm cipher;
- private readonly byte[] counter = new byte[BLOCK_SIZE_IN_BYTES];
- private readonly Stream stream;
- private readonly ICryptoTransform transform;
- private int nonce = 1;
- private byte[] counterOut = new byte[BLOCK_SIZE_IN_BYTES];
- private bool isFinalBlock;
- private long totalBytesLeftToRead;
- private bool isDisposed;
-
- internal WinzipAesCryptoStream(Stream stream, WinzipAesEncryptionData winzipAesEncryptionData, long length)
- {
- this.stream = stream;
- totalBytesLeftToRead = length;
-
- cipher = CreateCipher(winzipAesEncryptionData);
-
- var iv = new byte[BLOCK_SIZE_IN_BYTES];
- transform = cipher.CreateEncryptor(winzipAesEncryptionData.KeyBytes, iv);
- }
-
- private SymmetricAlgorithm CreateCipher(WinzipAesEncryptionData winzipAesEncryptionData)
- {
- RijndaelManaged cipher = new RijndaelManaged();
- cipher.BlockSize = BLOCK_SIZE_IN_BYTES * 8;
- cipher.KeySize = winzipAesEncryptionData.KeyBytes.Length * 8;
- cipher.Mode = CipherMode.ECB;
- cipher.Padding = PaddingMode.None;
- return cipher;
- }
-
- public override bool CanRead
- {
- get { return true; }
- }
-
- public override bool CanSeek
- {
- get { return false; }
- }
-
- public override bool CanWrite
- {
- get { return false; }
- }
-
- public override long Length
- {
- get { throw new NotImplementedException(); }
- }
-
- public override long Position
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- protected override void Dispose(bool disposing)
- {
- if (isDisposed)
- {
- return;
- }
- isDisposed = true;
- if (disposing)
- {
- //read out last 10 auth bytes
- var ten = new byte[10];
- stream.Read(ten, 0, 10);
- stream.Dispose();
- }
- }
-
- public override void Flush()
- {
- throw new NotImplementedException();
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- if (totalBytesLeftToRead == 0)
- {
- return 0;
- }
- int bytesToRead = count;
- if (count > totalBytesLeftToRead)
- {
- bytesToRead = (int)totalBytesLeftToRead;
- }
- int read = stream.Read(buffer, offset, bytesToRead);
- totalBytesLeftToRead -= read;
-
- ReadTransformBlocks(buffer, offset, read);
-
- return read;
- }
-
- private int ReadTransformOneBlock(byte[] buffer, int offset, int last)
- {
- if (isFinalBlock)
- {
- throw new InvalidOperationException();
- }
-
- int bytesRemaining = last - offset;
- int bytesToRead = (bytesRemaining > BLOCK_SIZE_IN_BYTES)
- ? BLOCK_SIZE_IN_BYTES
- : bytesRemaining;
-
- // update the counter
- Array.Copy(BitConverter.GetBytes(nonce++), 0, counter, 0, 4);
-
- // Determine if this is the final block
- if ((bytesToRead == bytesRemaining) && (totalBytesLeftToRead == 0))
- {
- counterOut = transform.TransformFinalBlock(counter,
- 0,
- BLOCK_SIZE_IN_BYTES);
- isFinalBlock = true;
- }
- else
- {
- transform.TransformBlock(counter,
- 0, // offset
- BLOCK_SIZE_IN_BYTES,
- counterOut,
- 0); // offset
- }
-
- XorInPlace(buffer, offset, bytesToRead);
- return bytesToRead;
- }
-
-
- private void XorInPlace(byte[] buffer, int offset, int count)
- {
- for (int i = 0; i < count; i++)
- {
- buffer[offset + i] = (byte)(counterOut[i] ^ buffer[offset + i]);
- }
- }
-
- private void ReadTransformBlocks(byte[] buffer, int offset, int count)
- {
- int posn = offset;
- int last = count + offset;
-
- while (posn < buffer.Length && posn < last)
- {
- int n = ReadTransformOneBlock(buffer, posn, last);
- posn += n;
- }
- }
-
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new NotImplementedException();
- }
-
- public override void SetLength(long value)
- {
- throw new NotImplementedException();
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- throw new NotImplementedException();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress.Common.Zip
-{
- internal class WinzipAesEncryptionData
- {
- private const int RFC2898_ITERATIONS = 1000;
-
- private byte[] salt;
- private WinzipAesKeySize keySize;
- private byte[] passwordVerifyValue;
- private string password;
-
- private byte[] generatedVerifyValue;
-
- internal WinzipAesEncryptionData(WinzipAesKeySize keySize, byte[] salt, byte[] passwordVerifyValue,
- string password)
- {
- this.keySize = keySize;
- this.salt = salt;
- this.passwordVerifyValue = passwordVerifyValue;
- this.password = password;
- Initialize();
- }
-
- internal byte[] IvBytes { get; set; }
- internal byte[] KeyBytes { get; set; }
-
- private int KeySizeInBytes
- {
- get { return KeyLengthInBytes(keySize); }
- }
-
- internal static int KeyLengthInBytes(WinzipAesKeySize keySize)
- {
- switch (keySize)
- {
- case WinzipAesKeySize.KeySize128:
- return 16;
- case WinzipAesKeySize.KeySize192:
- return 24;
- case WinzipAesKeySize.KeySize256:
- return 32;
- }
- throw new InvalidOperationException();
- }
-
- private void Initialize()
- {
- System.Security.Cryptography.Rfc2898DeriveBytes rfc2898 =
- new System.Security.Cryptography.Rfc2898DeriveBytes(password, salt, RFC2898_ITERATIONS);
-
- KeyBytes = rfc2898.GetBytes(KeySizeInBytes); // 16 or 24 or 32 ???
- IvBytes = rfc2898.GetBytes(KeySizeInBytes);
- generatedVerifyValue = rfc2898.GetBytes(2);
-
- short verify = BitConverter.ToInt16(passwordVerifyValue, 0);
- if (password != null)
- {
- short generated = BitConverter.ToInt16(generatedVerifyValue, 0);
- if (verify != generated)
- throw new InvalidFormatException("bad password");
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace SharpCompress.Common.Zip
-{
- internal enum WinzipAesKeySize
- {
- KeySize128 = 1,
- KeySize192 = 2,
- KeySize256 = 3,
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace SharpCompress.Common.Zip
-{
- internal enum ZipCompressionMethod
- {
- None = 0,
- Deflate = 8,
- Deflate64 = 9,
- BZip2 = 12,
- LZMA = 14,
- PPMd = 98,
- WinzipAes = 0x63 //http://www.winzip.com/aes_info.htm
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using SharpCompress.Common.Zip.Headers;
-
-namespace SharpCompress.Common.Zip
-{
- internal class ZipEntry : Entry
- {
- private readonly ZipFilePart filePart;
- private DateTime? lastModifiedTime;
-
- internal ZipEntry(ZipFilePart filePart)
- {
- if (filePart != null)
- {
- this.filePart = filePart;
- lastModifiedTime = Utility.DosDateToDateTime(filePart.Header.LastModifiedDate,
- filePart.Header.LastModifiedTime);
- if (lastModifiedTime == default(DateTime))
- {
- // On .NET on Windows, for zip entries that don't have a last write time,
- // the return value for ZipArchiveEntry.LastWriteTime is:
- // 1/1/1980 12:00:00 AM, Ticks=624511296000000000
- lastModifiedTime = new DateTime(624511296000000000);
- }
- }
- }
-
- public override CompressionType CompressionType
- {
- get
- {
- switch (filePart.Header.CompressionMethod)
- {
- case ZipCompressionMethod.BZip2:
- {
- return CompressionType.BZip2;
- }
- case ZipCompressionMethod.Deflate:
- {
- return CompressionType.Deflate;
- }
- case ZipCompressionMethod.LZMA:
- {
- return CompressionType.LZMA;
- }
- case ZipCompressionMethod.PPMd:
- {
- return CompressionType.PPMd;
- }
- case ZipCompressionMethod.None:
- {
- return CompressionType.None;
- }
- default:
- {
- return CompressionType.Unknown;
- }
- }
- }
- }
-
- public override uint Crc
- {
- get { return filePart.Header.Crc; }
- }
-
- public override string Key
- {
- get { return filePart.Header.Name; }
- }
-
- public override long CompressedSize
- {
- get { return filePart.Header.CompressedSize; }
- }
-
- public override long Size
- {
- get { return filePart.Header.UncompressedSize; }
- }
-
- public override DateTime? LastModifiedTime
- {
- get { return lastModifiedTime; }
- set { lastModifiedTime = value; }
- }
-
- public override DateTime? CreatedTime
- {
- get { return null; }
- }
-
- public override DateTime? LastAccessedTime
- {
- get { return null; }
- }
-
- public override DateTime? ArchivedTime
- {
- get { return null; }
- }
-
- public override bool IsEncrypted
- {
- get { return FlagUtility.HasFlag(filePart.Header.Flags, HeaderFlags.Encrypted); }
- }
-
- public override bool IsDirectory
- {
- get { return filePart.Header.IsDirectory; }
- }
-
- public override bool IsSplit
- {
- get { return false; }
- }
-
- internal override IEnumerable<FilePart> Parts
- {
- get { return filePart.AsEnumerable<FilePart>(); }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using System.Linq;
-using SharpCompress.Common.Zip.Headers;
-using SharpCompress.Compressor;
-#if BZIP2
-using SharpCompress.Compressor.BZip2;
-#endif
-#if DEFLATE
-using SharpCompress.Compressor.Deflate;
-#endif
-#if LZMA
-using SharpCompress.Compressor.LZMA;
-#endif
-#if PPMd
-using SharpCompress.Compressor.PPMd;
-#endif
-using SharpCompress.IO;
-
-namespace SharpCompress.Common.Zip
-{
- internal abstract class ZipFilePart : FilePart
- {
- internal ZipFilePart(ZipFileEntry header, Stream stream)
- {
- Header = header;
- header.Part = this;
- this.BaseStream = stream;
- }
-
- internal Stream BaseStream { get; private set; }
- internal ZipFileEntry Header { get; set; }
-
-
- internal override string FilePartName
- {
- get { return Header.Name; }
- }
-
- internal override Stream GetCompressedStream()
- {
- if (!Header.HasData)
- {
- return Stream.Null;
- }
- Stream decompressionStream = CreateDecompressionStream(GetCryptoStream(CreateBaseStream()));
- if (LeaveStreamOpen)
- {
- return new NonDisposingStream(decompressionStream);
- }
- return decompressionStream;
- }
-
- internal override Stream GetRawStream()
- {
- if (!Header.HasData)
- {
- return Stream.Null;
- }
- return CreateBaseStream();
- }
-
- protected abstract Stream CreateBaseStream();
-
- protected bool LeaveStreamOpen
- {
- get { return FlagUtility.HasFlag(Header.Flags, HeaderFlags.UsePostDataDescriptor); }
- }
-
- protected Stream CreateDecompressionStream(Stream stream)
- {
- switch (Header.CompressionMethod)
- {
- case ZipCompressionMethod.None:
- {
- return stream;
- }
- case ZipCompressionMethod.Deflate:
- {
- return new System.IO.Compression.DeflateStream(stream,
- System.IO.Compression.CompressionMode.Decompress);
- }
-#if BZIP2
- case ZipCompressionMethod.BZip2:
- {
- return new BZip2Stream(stream, CompressionMode.Decompress);
- }
-#endif
-#if LZMA
- case ZipCompressionMethod.LZMA:
- {
- if (FlagUtility.HasFlag(Header.Flags, HeaderFlags.Encrypted))
- {
- throw new NotSupportedException("LZMA with pkware encryption.");
- }
- var reader = new BinaryReader(stream);
- reader.ReadUInt16(); //LZMA version
- var props = new byte[reader.ReadUInt16()];
- reader.Read(props, 0, props.Length);
- return new LzmaStream(props, stream,
- Header.CompressedSize > 0 ? Header.CompressedSize - 4 - props.Length : -1,
- FlagUtility.HasFlag(Header.Flags, HeaderFlags.Bit1)
- ? -1
- : (long)Header.UncompressedSize);
- }
-#endif
-#if PPMd
- case ZipCompressionMethod.PPMd:
- {
- var props = new byte[2];
- stream.Read(props, 0, props.Length);
- return new PpmdStream(new PpmdProperties(props), stream, false);
- }
-#endif
- case ZipCompressionMethod.WinzipAes:
- {
- ExtraData data = Header.Extra.Where(x => x.Type == ExtraDataType.WinZipAes).SingleOrDefault();
- if (data == null)
- {
- throw new InvalidFormatException("No Winzip AES extra data found.");
- }
- if (data.Length != 7)
- {
- throw new InvalidFormatException("Winzip data length is not 7.");
- }
- ushort method = BitConverter.ToUInt16(data.DataBytes, 0);
-
- if (method != 0x01 && method != 0x02)
- {
- throw new InvalidFormatException("Unexpected vendor version number for WinZip AES metadata");
- }
-
- ushort vendorId = BitConverter.ToUInt16(data.DataBytes, 2);
- if (vendorId != 0x4541)
- {
- throw new InvalidFormatException("Unexpected vendor ID for WinZip AES metadata");
- }
- Header.CompressionMethod = (ZipCompressionMethod)BitConverter.ToUInt16(data.DataBytes, 5);
- return CreateDecompressionStream(stream);
- }
- default:
- {
- throw new NotSupportedException("CompressionMethod: " + Header.CompressionMethod);
- }
- }
- }
-
- protected Stream GetCryptoStream(Stream plainStream)
- {
- if ((Header.CompressedSize == 0)
-#if !PORTABLE && !NETFX_CORE
- && ((Header.PkwareTraditionalEncryptionData != null)
- || (Header.WinzipAesEncryptionData != null)))
-#else
- && (Header.PkwareTraditionalEncryptionData != null))
-#endif
- {
- throw new NotSupportedException("Cannot encrypt file with unknown size at start.");
- }
- if ((Header.CompressedSize == 0)
- && FlagUtility.HasFlag(Header.Flags, HeaderFlags.UsePostDataDescriptor))
- {
- plainStream = new NonDisposingStream(plainStream); //make sure AES doesn't close
- }
- else
- {
- plainStream = new ReadOnlySubStream(plainStream, Header.CompressedSize); //make sure AES doesn't close
- }
- if (Header.PkwareTraditionalEncryptionData != null)
- {
- return new PkwareTraditionalCryptoStream(plainStream, Header.PkwareTraditionalEncryptionData,
- CryptoMode.Decrypt);
- }
-#if !PORTABLE && !NETFX_CORE
- if (Header.WinzipAesEncryptionData != null)
- {
- //only read 10 less because the last ten are auth bytes
- return new WinzipAesCryptoStream(plainStream, Header.WinzipAesEncryptionData, Header.CompressedSize - 10);
- }
-#endif
- return plainStream;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using SharpCompress.Common.Zip.Headers;
-using SharpCompress.IO;
-#if !PORTABLE
-using System.Linq;
-
-#endif
-
-namespace SharpCompress.Common.Zip
-{
- internal class ZipHeaderFactory
- {
- internal const uint ENTRY_HEADER_BYTES = 0x04034b50;
- internal const uint POST_DATA_DESCRIPTOR = 0x08074b50;
- internal const uint DIRECTORY_START_HEADER_BYTES = 0x02014b50;
- internal const uint DIRECTORY_END_HEADER_BYTES = 0x06054b50;
- internal const uint DIGITAL_SIGNATURE = 0x05054b50;
- internal const uint SPLIT_ARCHIVE_HEADER_BYTES = 0x30304b50;
-
- private const uint ZIP64_END_OF_CENTRAL_DIRECTORY = 0x06064b50;
- private const uint ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR = 0x07064b50;
-
-
- protected LocalEntryHeader lastEntryHeader;
- private string password;
- private StreamingMode mode;
-
- protected ZipHeaderFactory(StreamingMode mode, string password)
- {
- this.mode = mode;
- this.password = password;
- }
-
- protected ZipHeader ReadHeader(uint headerBytes, BinaryReader reader)
- {
- switch (headerBytes)
- {
- case ENTRY_HEADER_BYTES:
- {
- var entryHeader = new LocalEntryHeader();
- entryHeader.Read(reader);
- LoadHeader(entryHeader, reader.BaseStream);
-
- lastEntryHeader = entryHeader;
- return entryHeader;
- }
- case DIRECTORY_START_HEADER_BYTES:
- {
- var entry = new DirectoryEntryHeader();
- entry.Read(reader);
- return entry;
- }
- case POST_DATA_DESCRIPTOR:
- {
- if (FlagUtility.HasFlag(lastEntryHeader.Flags, HeaderFlags.UsePostDataDescriptor))
- {
- lastEntryHeader.Crc = reader.ReadUInt32();
- lastEntryHeader.CompressedSize = reader.ReadUInt32();
- lastEntryHeader.UncompressedSize = reader.ReadUInt32();
- }
- else
- {
- reader.ReadUInt32();
- reader.ReadUInt32();
- reader.ReadUInt32();
- }
- return null;
- }
- case DIGITAL_SIGNATURE:
- return null;
- case DIRECTORY_END_HEADER_BYTES:
- {
- var entry = new DirectoryEndHeader();
- entry.Read(reader);
- return entry;
- }
- case SPLIT_ARCHIVE_HEADER_BYTES:
- {
- return new SplitHeader();
- }
- case ZIP64_END_OF_CENTRAL_DIRECTORY:
- case ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR:
- {
- var entry = new IgnoreHeader(ZipHeaderType.Ignore);
- entry.Read(reader);
- return entry;
- }
- default:
- throw new NotSupportedException("Unknown header: " + headerBytes);
- }
- }
-
- internal static bool IsHeader(uint headerBytes)
- {
- switch (headerBytes)
- {
- case ENTRY_HEADER_BYTES:
- case DIRECTORY_START_HEADER_BYTES:
- case POST_DATA_DESCRIPTOR:
- case DIGITAL_SIGNATURE:
- case DIRECTORY_END_HEADER_BYTES:
- case SPLIT_ARCHIVE_HEADER_BYTES:
- case ZIP64_END_OF_CENTRAL_DIRECTORY:
- case ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR:
- return true;
- default:
- return false;
- }
- }
-
- private void LoadHeader(ZipFileEntry entryHeader, Stream stream)
- {
- if (FlagUtility.HasFlag(entryHeader.Flags, HeaderFlags.Encrypted))
- {
- if (!entryHeader.IsDirectory &&
- entryHeader.CompressedSize == 0 &&
- FlagUtility.HasFlag(entryHeader.Flags, HeaderFlags.UsePostDataDescriptor))
- {
- throw new NotSupportedException(
- "SharpCompress cannot currently read non-seekable Zip Streams with encrypted data that has been written in a non-seekable manner.");
- }
- if (password == null)
- {
- throw new CryptographicException("No password supplied for encrypted zip.");
- }
- if (entryHeader.CompressionMethod != ZipCompressionMethod.WinzipAes)
- {
- byte[] buffer = new byte[12];
- stream.Read(buffer, 0, 12);
- entryHeader.PkwareTraditionalEncryptionData = PkwareTraditionalEncryptionData.ForRead(password,
- entryHeader,
- buffer);
- entryHeader.CompressedSize -= 12;
- }
- else
- {
-#if PORTABLE || NETFX_CORE
- throw new NotSupportedException("Cannot decrypt Winzip AES with Silverlight or WP7.");
-#else
-
- var data = entryHeader.Extra.Where(x => x.Type == ExtraDataType.WinZipAes).SingleOrDefault();
- WinzipAesKeySize keySize = (WinzipAesKeySize) data.DataBytes[4];
-
- byte[] salt = new byte[WinzipAesEncryptionData.KeyLengthInBytes(keySize)/2];
- byte[] passwordVerifyValue = new byte[2];
- stream.Read(salt, 0, salt.Length);
- stream.Read(passwordVerifyValue, 0, 2);
- entryHeader.WinzipAesEncryptionData = new WinzipAesEncryptionData(keySize, salt, passwordVerifyValue,
- password);
- entryHeader.CompressedSize -= (uint) (salt.Length + 2);
-
-#endif
- }
- }
- if (entryHeader.IsDirectory)
- {
- return;
- }
- //if (FlagUtility.HasFlag(entryHeader.Flags, HeaderFlags.UsePostDataDescriptor))
- //{
- // entryHeader.PackedStream = new ReadOnlySubStream(stream);
- //}
- //else
- //{
- switch (mode)
- {
- case StreamingMode.Seekable:
- {
- entryHeader.DataStartPosition = stream.Position;
- stream.Position += entryHeader.CompressedSize;
- }
- break;
- case StreamingMode.Streaming:
- {
- entryHeader.PackedStream = stream;
- }
- break;
- default:
- {
- throw new InvalidFormatException("Invalid StreamingMode");
- }
- }
- //}
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-
-namespace SharpCompress.Common.Zip
-{
- internal class ZipVolume : Volume
- {
- public ZipVolume(Stream stream, Options options)
- : base(stream, options)
- {
- }
-
- public string Comment { get; internal set; }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace SharpCompress.Compressor
-{
- internal enum CompressionMode
- {
- Compress = 0,
- Decompress = 1,
- }
-}
\ No newline at end of file
+++ /dev/null
-// Crc32.cs
-// ------------------------------------------------------------------
-//
-// Copyright (c) 2006-2009 Dino Chiesa and Microsoft Corporation.
-// All rights reserved.
-//
-// This code module is part of DotNetZip, a zipfile class library.
-//
-// ------------------------------------------------------------------
-//
-// This code is licensed under the Microsoft Public License.
-// See the file License.txt for the license details.
-// More info on: http://dotnetzip.codeplex.com
-//
-// ------------------------------------------------------------------
-//
-// last saved (in emacs):
-// Time-stamp: <2010-January-16 13:16:27>
-//
-// ------------------------------------------------------------------
-//
-// Implements the CRC algorithm, which is used in zip files. The zip format calls for
-// the zipfile to contain a CRC for the unencrypted byte stream of each file.
-//
-// It is based on example source code published at
-// http://www.vbaccelerator.com/home/net/code/libraries/CRC32/Crc32_zip_CRC32_CRC32_cs.asp
-//
-// This implementation adds a tweak of that code for use within zip creation. While
-// computing the CRC we also compress the byte stream, in the same read loop. This
-// avoids the need to read through the uncompressed stream twice - once to compute CRC
-// and another time to compress.
-//
-// ------------------------------------------------------------------
-
-
-using System;
-using System.IO;
-
-namespace SharpCompress.Compressor.Deflate
-{
- /// <summary>
- /// Calculates a 32bit Cyclic Redundancy Checksum (CRC) using the same polynomial
- /// used by Zip. This type is used internally by DotNetZip; it is generally not used
- /// directly by applications wishing to create, read, or manipulate zip archive
- /// files.
- /// </summary>
- internal class CRC32
- {
- private const int BUFFER_SIZE = 8192;
- private static readonly UInt32[] crc32Table;
- private UInt32 runningCrc32Result = 0xFFFFFFFF;
- private Int64 totalBytesRead;
-
- static CRC32()
- {
- unchecked
- {
- // PKZip specifies CRC32 with a polynomial of 0xEDB88320;
- // This is also the CRC-32 polynomial used bby Ethernet, FDDI,
- // bzip2, gzip, and others.
- // Often the polynomial is shown reversed as 0x04C11DB7.
- // For more details, see http://en.wikipedia.org/wiki/Cyclic_redundancy_check
- UInt32 dwPolynomial = 0xEDB88320;
- UInt32 i, j;
-
- crc32Table = new UInt32[256];
-
- UInt32 dwCrc;
- for (i = 0; i < 256; i++)
- {
- dwCrc = i;
- for (j = 8; j > 0; j--)
- {
- if ((dwCrc & 1) == 1)
- {
- dwCrc = (dwCrc >> 1) ^ dwPolynomial;
- }
- else
- {
- dwCrc >>= 1;
- }
- }
- crc32Table[i] = dwCrc;
- }
- }
- }
-
- /// <summary>
- /// indicates the total number of bytes read on the CRC stream.
- /// This is used when writing the ZipDirEntry when compressing files.
- /// </summary>
- public Int64 TotalBytesRead
- {
- get { return totalBytesRead; }
- }
-
- /// <summary>
- /// Indicates the current CRC for all blocks slurped in.
- /// </summary>
- public Int32 Crc32Result
- {
- get
- {
- // return one's complement of the running result
- return unchecked((Int32) (~runningCrc32Result));
- }
- }
-
- /// <summary>
- /// Returns the CRC32 for the specified stream.
- /// </summary>
- /// <param name="input">The stream over which to calculate the CRC32</param>
- /// <returns>the CRC32 calculation</returns>
- public Int32 GetCrc32(Stream input)
- {
- return GetCrc32AndCopy(input, null);
- }
-
- /// <summary>
- /// Returns the CRC32 for the specified stream, and writes the input into the
- /// output stream.
- /// </summary>
- /// <param name="input">The stream over which to calculate the CRC32</param>
- /// <param name="output">The stream into which to deflate the input</param>
- /// <returns>the CRC32 calculation</returns>
- public Int32 GetCrc32AndCopy(Stream input, Stream output)
- {
- if (input == null)
- throw new ZlibException("The input stream must not be null.");
-
- unchecked
- {
- //UInt32 crc32Result;
- //crc32Result = 0xFFFFFFFF;
- var buffer = new byte[BUFFER_SIZE];
- int readSize = BUFFER_SIZE;
-
- totalBytesRead = 0;
- int count = input.Read(buffer, 0, readSize);
- if (output != null) output.Write(buffer, 0, count);
- totalBytesRead += count;
- while (count > 0)
- {
- SlurpBlock(buffer, 0, count);
- count = input.Read(buffer, 0, readSize);
- if (output != null) output.Write(buffer, 0, count);
- totalBytesRead += count;
- }
-
- return (Int32) (~runningCrc32Result);
- }
- }
-
-
- /// <summary>
- /// Get the CRC32 for the given (word,byte) combo. This is a computation
- /// defined by PKzip.
- /// </summary>
- /// <param name="W">The word to start with.</param>
- /// <param name="B">The byte to combine it with.</param>
- /// <returns>The CRC-ized result.</returns>
- public Int32 ComputeCrc32(Int32 W, byte B)
- {
- return _InternalComputeCrc32((UInt32) W, B);
- }
-
- internal Int32 _InternalComputeCrc32(UInt32 W, byte B)
- {
- return (Int32) (crc32Table[(W ^ B) & 0xFF] ^ (W >> 8));
- }
-
- /// <summary>
- /// Update the value for the running CRC32 using the given block of bytes.
- /// This is useful when using the CRC32() class in a Stream.
- /// </summary>
- /// <param name="block">block of bytes to slurp</param>
- /// <param name="offset">starting point in the block</param>
- /// <param name="count">how many bytes within the block to slurp</param>
- public void SlurpBlock(byte[] block, int offset, int count)
- {
- if (block == null)
- throw new ZlibException("The data buffer must not be null.");
-
- for (int i = 0; i < count; i++)
- {
- int x = offset + i;
- runningCrc32Result = ((runningCrc32Result) >> 8) ^
- crc32Table[(block[x]) ^ ((runningCrc32Result) & 0x000000FF)];
- }
- totalBytesRead += count;
- }
-
-
- // pre-initialize the crc table for speed of lookup.
-
-
- private uint gf2_matrix_times(uint[] matrix, uint vec)
- {
- uint sum = 0;
- int i = 0;
- while (vec != 0)
- {
- if ((vec & 0x01) == 0x01)
- sum ^= matrix[i];
- vec >>= 1;
- i++;
- }
- return sum;
- }
-
- private void gf2_matrix_square(uint[] square, uint[] mat)
- {
- for (int i = 0; i < 32; i++)
- square[i] = gf2_matrix_times(mat, mat[i]);
- }
-
-
- /// <summary>
- /// Combines the given CRC32 value with the current running total.
- /// </summary>
- /// <remarks>
- /// This is useful when using a divide-and-conquer approach to calculating a CRC.
- /// Multiple threads can each calculate a CRC32 on a segment of the data, and then
- /// combine the individual CRC32 values at the end.
- /// </remarks>
- /// <param name="crc">the crc value to be combined with this one</param>
- /// <param name="length">the length of data the CRC value was calculated on</param>
- public void Combine(int crc, int length)
- {
- var even = new uint[32]; // even-power-of-two zeros operator
- var odd = new uint[32]; // odd-power-of-two zeros operator
-
- if (length == 0)
- return;
-
- uint crc1 = ~runningCrc32Result;
- var crc2 = (uint) crc;
-
- // put operator for one zero bit in odd
- odd[0] = 0xEDB88320; // the CRC-32 polynomial
- uint row = 1;
- for (int i = 1; i < 32; i++)
- {
- odd[i] = row;
- row <<= 1;
- }
-
- // put operator for two zero bits in even
- gf2_matrix_square(even, odd);
-
- // put operator for four zero bits in odd
- gf2_matrix_square(odd, even);
-
- var len2 = (uint) length;
-
- // apply len2 zeros to crc1 (first square will put the operator for one
- // zero byte, eight zero bits, in even)
- do
- {
- // apply zeros operator for this bit of len2
- gf2_matrix_square(even, odd);
-
- if ((len2 & 1) == 1)
- crc1 = gf2_matrix_times(even, crc1);
- len2 >>= 1;
-
- if (len2 == 0)
- break;
-
- // another iteration of the loop with odd and even swapped
- gf2_matrix_square(odd, even);
- if ((len2 & 1) == 1)
- crc1 = gf2_matrix_times(odd, crc1);
- len2 >>= 1;
- } while (len2 != 0);
-
- crc1 ^= crc2;
-
- runningCrc32Result = ~crc1;
-
- //return (int) crc1;
- return;
- }
-
-
- // private member vars
- }
-}
\ No newline at end of file
+++ /dev/null
-// Zlib.cs
-// ------------------------------------------------------------------
-//
-// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation.
-// All rights reserved.
-//
-// This code module is part of DotNetZip, a zipfile class library.
-//
-// ------------------------------------------------------------------
-//
-// This code is licensed under the Microsoft Public License.
-// See the file License.txt for the license details.
-// More info on: http://dotnetzip.codeplex.com
-//
-// ------------------------------------------------------------------
-//
-// last saved (in emacs):
-// Time-stamp: <2009-November-07 05:26:55>
-//
-// ------------------------------------------------------------------
-//
-// This module defines classes for ZLIB compression and
-// decompression. This code is derived from the jzlib implementation of
-// zlib, but significantly modified. The object model is not the same,
-// and many of the behaviors are new or different. Nonetheless, in
-// keeping with the license for jzlib, the copyright to that code is
-// included below.
-//
-// ------------------------------------------------------------------
-//
-// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in
-// the documentation and/or other materials provided with the distribution.
-//
-// 3. The names of the authors may not be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
-// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
-// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// -----------------------------------------------------------------------
-//
-// This program is based on zlib-1.1.3; credit to authors
-// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)
-// and contributors of zlib.
-//
-// -----------------------------------------------------------------------
-
-
-namespace SharpCompress.Compressor.Deflate
-{
- /// <summary>
- /// The compression level to be used when using a DeflateStream or ZlibStream with CompressionMode.Compress.
- /// </summary>
- internal enum CompressionLevel
- {
- /// <summary>
- /// None means that the data will be simply stored, with no change at all.
- /// If you are producing ZIPs for use on Mac OSX, be aware that archives produced with CompressionLevel.None
- /// cannot be opened with the default zip reader. Use a different CompressionLevel.
- /// </summary>
- None = 0,
-
- /// <summary>
- /// Same as None.
- /// </summary>
- Level0 = 0,
-
- /// <summary>
- /// The fastest but least effective compression.
- /// </summary>
- BestSpeed = 1,
-
- /// <summary>
- /// A synonym for BestSpeed.
- /// </summary>
- Level1 = 1,
-
- /// <summary>
- /// A little slower, but better, than level 1.
- /// </summary>
- Level2 = 2,
-
- /// <summary>
- /// A little slower, but better, than level 2.
- /// </summary>
- Level3 = 3,
-
- /// <summary>
- /// A little slower, but better, than level 3.
- /// </summary>
- Level4 = 4,
-
- /// <summary>
- /// A little slower than level 4, but with better compression.
- /// </summary>
- Level5 = 5,
-
- /// <summary>
- /// The default compression level, with a good balance of speed and compression efficiency.
- /// </summary>
- Default = 6,
-
- /// <summary>
- /// A synonym for Default.
- /// </summary>
- Level6 = 6,
-
- /// <summary>
- /// Pretty good compression!
- /// </summary>
- Level7 = 7,
-
- /// <summary>
- /// Better compression than Level7!
- /// </summary>
- Level8 = 8,
-
- /// <summary>
- /// The "best" compression, where best means greatest reduction in size of the input data stream.
- /// This is also the slowest compression.
- /// </summary>
- BestCompression = 9,
-
- /// <summary>
- /// A synonym for BestCompression.
- /// </summary>
- Level9 = 9,
- }
-
- /// <summary>
- /// Describes options for how the compression algorithm is executed. Different strategies
- /// work better on different sorts of data. The strategy parameter can affect the compression
- /// ratio and the speed of compression but not the correctness of the compresssion.
- /// </summary>
- internal enum CompressionStrategy
- {
- /// <summary>
- /// The default strategy is probably the best for normal data.
- /// </summary>
- Default = 0,
-
- /// <summary>
- /// The <c>Filtered</c> strategy is intended to be used most effectively with data produced by a
- /// filter or predictor. By this definition, filtered data consists mostly of small
- /// values with a somewhat random distribution. In this case, the compression algorithm
- /// is tuned to compress them better. The effect of <c>Filtered</c> is to force more Huffman
- /// coding and less string matching; it is a half-step between <c>Default</c> and <c>HuffmanOnly</c>.
- /// </summary>
- Filtered = 1,
-
- /// <summary>
- /// Using <c>HuffmanOnly</c> will force the compressor to do Huffman encoding only, with no
- /// string matching.
- /// </summary>
- HuffmanOnly = 2,
- }
-
-
- /// <summary>
- /// A general purpose exception class for exceptions in the Zlib library.
- /// </summary>
- internal class ZlibException : System.Exception
- {
- /// <summary>
- /// The ZlibException class captures exception information generated
- /// by the Zlib library.
- /// </summary>
- public ZlibException()
- : base()
- {
- }
-
- /// <summary>
- /// This ctor collects a message attached to the exception.
- /// </summary>
- /// <param name="s"></param>
- public ZlibException(System.String s)
- : base(s)
- {
- }
- }
-
- /// <summary>
- /// Computes an Adler-32 checksum.
- /// </summary>
- /// <remarks>
- /// The Adler checksum is similar to a CRC checksum, but faster to compute, though less
- /// reliable. It is used in producing RFC1950 compressed streams. The Adler checksum
- /// is a required part of the "ZLIB" standard. Applications will almost never need to
- /// use this class directly.
- /// </remarks>
- internal sealed class Adler
- {
- // largest prime smaller than 65536
- private static readonly int BASE = 65521;
- // NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1
- private static readonly int NMAX = 5552;
-
- internal static uint Adler32(uint adler, byte[] buf, int index, int len)
- {
- if (buf == null)
- return 1;
-
- int s1 = (int) (adler & 0xffff);
- int s2 = (int) ((adler >> 16) & 0xffff);
-
- while (len > 0)
- {
- int k = len < NMAX ? len : NMAX;
- len -= k;
- while (k >= 16)
- {
- //s1 += (buf[index++] & 0xff); s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- s1 += buf[index++];
- s2 += s1;
- k -= 16;
- }
- if (k != 0)
- {
- do
- {
- s1 += buf[index++];
- s2 += s1;
- } while (--k != 0);
- }
- s1 %= BASE;
- s2 %= BASE;
- }
- return (uint) ((s2 << 16) | s1);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-
-namespace SharpCompress
-{
- internal static class EnumExtensions
- {
- public static bool HasFlag(this Enum enumRef, Enum flag)
- {
- long value = Convert.ToInt64(enumRef);
- long flagVal = Convert.ToInt64(flag);
-
- return (value & flagVal) == flagVal;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace SharpCompress.IO
-{
- internal class ReadOnlyAppendingStream : Stream
- {
- private readonly Queue<Stream> streams;
- private Stream current;
-
- public ReadOnlyAppendingStream(IEnumerable<Stream> streams)
- {
- this.streams = new Queue<Stream>(streams);
- }
-
- public override bool CanRead
- {
- get { return true; }
- }
-
- public override bool CanSeek
- {
- get { return false; }
- }
-
- public override bool CanWrite
- {
- get { return false; }
- }
-
- public override void Flush()
- {
- throw new NotImplementedException();
- }
-
- public override long Length
- {
- get { throw new NotImplementedException(); }
- }
-
- public override long Position
- {
- get
- {
- throw new NotImplementedException();
- }
- set
- {
- throw new NotImplementedException();
- }
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- if (current == null && streams.Count == 0)
- {
- return -1;
- }
- if (current == null)
- {
- current = streams.Dequeue();
- }
- int totalRead = 0;
- while (totalRead < count)
- {
- int read = current.Read(buffer, offset + totalRead, count - totalRead);
- if (read <= 0)
- {
- if (streams.Count == 0)
- {
- return totalRead;
- }
- else
- {
- current = streams.Dequeue();
- }
- }
- totalRead += read;
- }
- return totalRead;
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new NotImplementedException();
- }
-
- public override void SetLength(long value)
- {
- throw new NotImplementedException();
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- throw new NotImplementedException();
- }
- }
-}
+++ /dev/null
-using System;
-using System.IO;
-
-namespace SharpCompress.IO
-{
- internal class CountingWritableSubStream : Stream
- {
- private Stream writableStream;
-
- internal CountingWritableSubStream(Stream stream)
- {
- writableStream = stream;
- }
-
- public uint Count { get; private set; }
-
- public override bool CanRead
- {
- get { return false; }
- }
-
- public override bool CanSeek
- {
- get { return false; }
- }
-
- public override bool CanWrite
- {
- get { return true; }
- }
-
- public override void Flush()
- {
- }
-
- public override long Length
- {
- get { throw new NotImplementedException(); }
- }
-
- public override long Position
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- throw new NotImplementedException();
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new NotImplementedException();
- }
-
- public override void SetLength(long value)
- {
- throw new NotImplementedException();
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- writableStream.Write(buffer, offset, count);
- Count += (uint) count;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-using SharpCompress.Common;
-
-namespace SharpCompress.IO
-{
- internal class ListeningStream : Stream
- {
- private long currentEntryTotalReadBytes;
- private IExtractionListener listener;
-
- public ListeningStream(IExtractionListener listener, Stream stream)
- {
- Stream = stream;
- this.listener = listener;
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- Stream.Dispose();
- }
- }
-
- public Stream Stream { get; private set; }
-
- public override bool CanRead
- {
- get { return Stream.CanRead; }
- }
-
- public override bool CanSeek
- {
- get { return Stream.CanSeek; }
- }
-
- public override bool CanWrite
- {
- get { return Stream.CanWrite; }
- }
-
- public override void Flush()
- {
- Stream.Flush();
- }
-
- public override long Length
- {
- get { return Stream.Length; }
- }
-
- public override long Position
- {
- get { return Stream.Position; }
- set { Stream.Position = value; }
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- int read = Stream.Read(buffer, offset, count);
- currentEntryTotalReadBytes += read;
- listener.FireCompressedBytesRead(currentEntryTotalReadBytes, currentEntryTotalReadBytes);
- return read;
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- return Stream.Seek(offset, origin);
- }
-
- public override void SetLength(long value)
- {
- Stream.SetLength(value);
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- Stream.Write(buffer, offset, count);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using System.Linq;
-
-namespace SharpCompress.IO
-{
- internal class MarkingBinaryReader : BinaryReader
- {
-
- public MarkingBinaryReader(Stream stream)
- : base(stream)
- {
- }
-
- public long CurrentReadByteCount { get; private set; }
-
- public void Mark()
- {
- CurrentReadByteCount = 0;
- }
-
- public override int Read()
- {
- throw new NotImplementedException();
- }
-
- public override int Read(byte[] buffer, int index, int count)
- {
- throw new NotImplementedException();
- }
-
- public override int Read(char[] buffer, int index, int count)
- {
- throw new NotImplementedException();
- }
-
- public override bool ReadBoolean()
- {
- return BitConverter.ToBoolean(ReadBytes(1), 0);
- }
-
- public override byte ReadByte()
- {
- return ReadBytes(1).Single();
- }
-
- public override byte[] ReadBytes(int count)
- {
- CurrentReadByteCount += count;
- var bytes = base.ReadBytes(count);
- if (bytes.Length != count)
- {
- throw new EndOfStreamException(string.Format("Could not read the requested amount of bytes. End of stream reached. Requested: {0} Read: {1}", count, bytes.Length));
- }
- return bytes;
- }
-
- public override char ReadChar()
- {
- throw new NotImplementedException();
- }
-
- public override char[] ReadChars(int count)
- {
- throw new NotImplementedException();
- }
-
-#if !PORTABLE
- public override decimal ReadDecimal()
- {
- return ByteArrayToDecimal(ReadBytes(16), 0);
- }
-
- private decimal ByteArrayToDecimal(byte[] src, int offset)
- {
- //http://stackoverflow.com/a/16984356/385387
- var i1 = BitConverter.ToInt32(src, offset);
- var i2 = BitConverter.ToInt32(src, offset + 4);
- var i3 = BitConverter.ToInt32(src, offset + 8);
- var i4 = BitConverter.ToInt32(src, offset + 12);
-
- return new decimal(new[] { i1, i2, i3, i4 });
- }
-#endif
-
- public override double ReadDouble()
- {
- return BitConverter.ToDouble(ReadBytes(8), 0);
- }
-
- public override short ReadInt16()
- {
- return BitConverter.ToInt16(ReadBytes(2), 0);
- }
-
- public override int ReadInt32()
- {
- return BitConverter.ToInt32(ReadBytes(4), 0);
- }
-
- public override long ReadInt64()
- {
- return BitConverter.ToInt64(ReadBytes(8), 0);
- }
-
- public override sbyte ReadSByte()
- {
- return (sbyte)ReadByte();
- }
-
- public override float ReadSingle()
- {
- return BitConverter.ToSingle(ReadBytes(4), 0);
- }
-
- public override string ReadString()
- {
- throw new NotImplementedException();
- }
-
- public override ushort ReadUInt16()
- {
- return BitConverter.ToUInt16(ReadBytes(2), 0);
- }
-
- public override uint ReadUInt32()
- {
- return BitConverter.ToUInt32(ReadBytes(4), 0);
- }
-
- public override ulong ReadUInt64()
- {
- return BitConverter.ToUInt64(ReadBytes(8), 0);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-
-namespace SharpCompress.IO
-{
- internal class NonDisposingStream : Stream
- {
- public NonDisposingStream(Stream stream)
- {
- Stream = stream;
- }
-
- protected override void Dispose(bool disposing)
- {
- //don't dispose anything
- }
-
- public Stream Stream { get; private set; }
-
- public override bool CanRead
- {
- get { return Stream.CanRead; }
- }
-
- public override bool CanSeek
- {
- get { return Stream.CanSeek; }
- }
-
- public override bool CanWrite
- {
- get { return Stream.CanWrite; }
- }
-
- public override void Flush()
- {
- Stream.Flush();
- }
-
- public override long Length
- {
- get { return Stream.Length; }
- }
-
- public override long Position
- {
- get { return Stream.Position; }
- set { Stream.Position = value; }
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- return Stream.Read(buffer, offset, count);
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- return Stream.Seek(offset, origin);
- }
-
- public override void SetLength(long value)
- {
- Stream.SetLength(value);
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- Stream.Write(buffer, offset, count);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-
-namespace SharpCompress.IO
-{
- internal class ReadOnlySubStream : Stream
- {
- public ReadOnlySubStream(Stream stream, long bytesToRead)
- : this(stream, null, bytesToRead)
- {
- }
-
- public ReadOnlySubStream(Stream stream, long? origin, long bytesToRead)
- {
- Stream = stream;
- if (origin != null)
- {
- stream.Position = origin.Value;
- }
- length = bytesToRead;
- BytesLeftToRead = bytesToRead;
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- //Stream.Dispose();
- }
- }
-
- private long length;
-
- private long BytesLeftToRead { get; set; }
-
- public Stream Stream { get; private set; }
-
- public override bool CanRead
- {
- get { return true; }
- }
-
- public override bool CanSeek
- {
- get { return false; }
- }
-
- public override bool CanWrite
- {
- get { return false; }
- }
-
- public override void Flush()
- {
- throw new System.NotImplementedException();
- }
-
- public override long Length
- {
- get { return length; }
- }
-
- public override long Position
- {
- get { return Length - BytesLeftToRead; }
- set { throw new System.NotImplementedException(); }
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- if (BytesLeftToRead < count)
- {
- count = (int)BytesLeftToRead;
- }
- int read = Stream.Read(buffer, offset, count);
- if (read > 0)
- {
- BytesLeftToRead -= read;
- }
- return read;
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new System.NotImplementedException();
- }
-
- public override void SetLength(long value)
- {
- throw new System.NotImplementedException();
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- throw new System.NotImplementedException();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-
-namespace SharpCompress.IO
-{
- internal class RewindableStream : Stream
- {
- private readonly Stream stream;
- private MemoryStream bufferStream = new MemoryStream();
- private bool isRewound;
- private bool isDisposed;
-
- public RewindableStream(Stream stream)
- {
- this.stream = stream;
- }
-
- internal bool IsRecording { get; private set; }
-
- protected override void Dispose(bool disposing)
- {
- if (isDisposed)
- {
- return;
- }
- isDisposed = true;
- base.Dispose(disposing);
- if (disposing)
- {
- stream.Dispose();
- }
- }
-
- public void Rewind(bool stopRecording)
- {
- isRewound = true;
- IsRecording = !stopRecording;
- bufferStream.Position = 0;
- }
-
- public void Rewind(MemoryStream buffer)
- {
- if (bufferStream.Position >= buffer.Length)
- {
- bufferStream.Position -= buffer.Length;
- }
- else
- {
- bufferStream.TransferTo(buffer);
- bufferStream = buffer;
- bufferStream.Position = 0;
- }
- isRewound = true;
- }
-
- public void StartRecording()
- {
- //if (isRewound && bufferStream.Position != 0)
- // throw new System.NotImplementedException();
- if (bufferStream.Position != 0)
- {
- byte[] data = bufferStream.ToArray();
- long position = bufferStream.Position;
- bufferStream.SetLength(0);
- bufferStream.Write(data, (int)position, data.Length - (int)position);
- bufferStream.Position = 0;
- }
- IsRecording = true;
- }
-
- public override bool CanRead
- {
- get { return true; }
- }
-
- public override bool CanSeek
- {
- get { return false; }
- }
-
- public override bool CanWrite
- {
- get { return false; }
- }
-
- public override void Flush()
- {
- throw new System.NotImplementedException();
- }
-
- public override long Length
- {
- get { throw new System.NotImplementedException(); }
- }
-
- public override long Position
- {
- get { return stream.Position + bufferStream.Position - bufferStream.Length; }
- set
- {
- if (!isRewound)
- {
- stream.Position = value;
- }
- else if (value < stream.Position - bufferStream.Length || value >= stream.Position)
- {
- stream.Position = value;
- isRewound = false;
- bufferStream.SetLength(0);
- }
- else
- {
- bufferStream.Position = value - stream.Position + bufferStream.Length;
- }
- }
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- int read;
- if (isRewound && bufferStream.Position != bufferStream.Length)
- {
- read = bufferStream.Read(buffer, offset, count);
- if (read < count)
- {
- int tempRead = stream.Read(buffer, offset + read, count - read);
- if (IsRecording)
- {
- bufferStream.Write(buffer, offset + read, tempRead);
- }
- read += tempRead;
- }
- if (bufferStream.Position == bufferStream.Length && !IsRecording)
- {
- isRewound = false;
- bufferStream.SetLength(0);
- }
- return read;
- }
-
- read = stream.Read(buffer, offset, count);
- if (IsRecording)
- {
- bufferStream.Write(buffer, offset, read);
- }
- return read;
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new System.NotImplementedException();
- }
-
- public override void SetLength(long value)
- {
- throw new System.NotImplementedException();
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- throw new System.NotImplementedException();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-namespace SharpCompress.IO
-{
- internal enum StreamingMode
- {
- Streaming,
- Seekable,
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-
-namespace SharpCompress
-{
- internal class LazyReadOnlyCollection<T> : ICollection<T>
- {
- private readonly List<T> backing = new List<T>();
- private readonly IEnumerator<T> source;
- private bool fullyLoaded;
-
- public LazyReadOnlyCollection(IEnumerable<T> source)
- {
- this.source = source.GetEnumerator();
- }
-
- private class LazyLoader : IEnumerator<T>
- {
- private readonly LazyReadOnlyCollection<T> lazyReadOnlyCollection;
- private bool disposed;
- private int index = -1;
-
- internal LazyLoader(LazyReadOnlyCollection<T> lazyReadOnlyCollection)
- {
- this.lazyReadOnlyCollection = lazyReadOnlyCollection;
- }
-
- #region IEnumerator<T> Members
-
- public T Current
- {
- get { return lazyReadOnlyCollection.backing[index]; }
- }
-
- #endregion
-
- #region IDisposable Members
-
- public void Dispose()
- {
- if (!disposed)
- {
- disposed = true;
- }
- }
-
- #endregion
-
- #region IEnumerator Members
-
- object System.Collections.IEnumerator.Current
- {
- get { return Current; }
- }
-
- public bool MoveNext()
- {
- if (index + 1 < lazyReadOnlyCollection.backing.Count)
- {
- index++;
- return true;
- }
- if (!lazyReadOnlyCollection.fullyLoaded && lazyReadOnlyCollection.source.MoveNext())
- {
- lazyReadOnlyCollection.backing.Add(lazyReadOnlyCollection.source.Current);
- index++;
- return true;
- }
- lazyReadOnlyCollection.fullyLoaded = true;
- return false;
- }
-
- public void Reset()
- {
- throw new NotImplementedException();
- }
-
- #endregion
- }
-
- internal void EnsureFullyLoaded()
- {
- if (!fullyLoaded)
- {
- this.ForEach(x => { });
- fullyLoaded = true;
- }
- }
-
- internal IEnumerable<T> GetLoaded()
- {
- return backing;
- }
-
- #region ICollection<T> Members
-
- public void Add(T item)
- {
- throw new NotImplementedException();
- }
-
- public void Clear()
- {
- throw new NotImplementedException();
- }
-
- public bool Contains(T item)
- {
- EnsureFullyLoaded();
- return backing.Contains(item);
- }
-
- public void CopyTo(T[] array, int arrayIndex)
- {
- EnsureFullyLoaded();
- backing.CopyTo(array, arrayIndex);
- }
-
- public int Count
- {
- get
- {
- EnsureFullyLoaded();
- return backing.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get { return true; }
- }
-
- public bool Remove(T item)
- {
- throw new NotImplementedException();
- }
-
- #endregion
-
- #region IEnumerable<T> Members
-
- //TODO check for concurrent access
- public IEnumerator<T> GetEnumerator()
- {
- return new LazyLoader(this);
- }
-
- #endregion
-
- #region IEnumerable Members
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- #endregion
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-
-namespace SharpCompress
-{
- internal class ReadOnlyCollection<T> : ICollection<T>
- {
- private ICollection<T> collection;
-
- public ReadOnlyCollection(ICollection<T> collection)
- {
- this.collection = collection;
- }
-
- public void Add(T item)
- {
- throw new NotImplementedException();
- }
-
- public void Clear()
- {
- throw new NotImplementedException();
- }
-
- public bool Contains(T item)
- {
- return collection.Contains(item);
- }
-
- public void CopyTo(T[] array, int arrayIndex)
- {
- collection.CopyTo(array, arrayIndex);
- }
-
- public int Count
- {
- get { return collection.Count; }
- }
-
- public bool IsReadOnly
- {
- get { return true; }
- }
-
- public bool Remove(T item)
- {
- throw new NotImplementedException();
- }
-
- public IEnumerator<T> GetEnumerator()
- {
- return collection.GetEnumerator();
- }
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- throw new NotImplementedException();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using SharpCompress.Common;
-
-#if PORTABLE
-using SharpCompress.Common.Rar.Headers;
-#endif
-
-namespace SharpCompress.Reader
-{
- /// <summary>
- /// A generic push reader that reads unseekable comrpessed streams.
- /// </summary>
- internal abstract class AbstractReader<TEntry, TVolume> : IReader, IExtractionListener
- where TEntry : Entry
- where TVolume : Volume
- {
- private bool completed;
- private IEnumerator<TEntry> entriesForCurrentReadStream;
- private bool wroteCurrentEntry;
-
- public event EventHandler<CompressedBytesReadEventArgs> CompressedBytesRead;
- public event EventHandler<FilePartExtractionBeginEventArgs> FilePartExtractionBegin;
-
- internal AbstractReader(Options options, ArchiveType archiveType)
- {
- ArchiveType = archiveType;
- Options = options;
- }
-
- internal Options Options { get; private set; }
-
- public ArchiveType ArchiveType { get; private set; }
-
- /// <summary>
- /// Current volume that the current entry resides in
- /// </summary>
- public abstract TVolume Volume { get; }
-
- /// <summary>
- /// Current file entry
- /// </summary>
- public TEntry Entry
- {
- get { return entriesForCurrentReadStream.Current; }
- }
-
- #region IDisposable Members
-
- public void Dispose()
- {
- if (entriesForCurrentReadStream != null)
- {
- entriesForCurrentReadStream.Dispose();
- }
- Volume.Dispose();
- }
-
- #endregion
-
- public bool MoveToNextEntry()
- {
- if (completed)
- {
- return false;
- }
- if (entriesForCurrentReadStream == null)
- {
- return LoadStreamForReading(RequestInitialStream());
- }
- if (!wroteCurrentEntry)
- {
- SkipEntry();
- }
- wroteCurrentEntry = false;
- if (NextEntryForCurrentStream())
- {
- return true;
- }
- completed = true;
- return false;
- }
-
- internal bool LoadStreamForReading(Stream stream)
- {
- if (entriesForCurrentReadStream != null)
- {
- entriesForCurrentReadStream.Dispose();
- }
- if ((stream == null) || (!stream.CanRead))
- {
- throw new MultipartStreamRequiredException("File is split into multiple archives: '"
- + Entry.Key +
- "'. A new readable stream is required. Use Cancel if it was intended.");
- }
- entriesForCurrentReadStream = GetEntries(stream).GetEnumerator();
- if (entriesForCurrentReadStream.MoveNext())
- {
- return true;
- }
- return false;
- }
-
- internal virtual Stream RequestInitialStream()
- {
- return Volume.Stream;
- }
-
- internal virtual bool NextEntryForCurrentStream()
- {
- return entriesForCurrentReadStream.MoveNext();
- }
-
- internal abstract IEnumerable<TEntry> GetEntries(Stream stream);
-
- #region Entry Skip/Write
-
- private void SkipEntry()
- {
- if (!Entry.IsDirectory)
- {
- Skip();
- }
- }
-
- private readonly byte[] skipBuffer = new byte[4096];
-
- private void Skip()
- {
- if (!Entry.IsSolid)
- {
- var rawStream = Entry.Parts.First().GetRawStream();
-
- if (rawStream != null)
- {
- var bytesToAdvance = Entry.CompressedSize;
- for (var i = 0; i < bytesToAdvance / skipBuffer.Length; i++)
- {
- rawStream.Read(skipBuffer, 0, skipBuffer.Length);
- }
- rawStream.Read(skipBuffer, 0, (int)(bytesToAdvance % skipBuffer.Length));
- return;
- }
- }
- using (var s = OpenEntryStream())
- {
- while (s.Read(skipBuffer, 0, skipBuffer.Length) > 0)
- {
- }
- }
- }
-
- public void WriteEntryTo(Stream writableStream)
- {
- if (wroteCurrentEntry)
- {
- throw new ArgumentException("WriteEntryTo or OpenEntryStream can only be called once.");
- }
- if ((writableStream == null) || (!writableStream.CanWrite))
- {
- throw new ArgumentNullException(
- "A writable Stream was required. Use Cancel if that was intended.");
- }
- Write(writableStream);
- wroteCurrentEntry = true;
- }
-
- internal void Write(Stream writeStream)
- {
- using (Stream s = OpenEntryStream())
- {
- s.TransferTo(writeStream);
- }
- }
-
- public EntryStream OpenEntryStream()
- {
- if (wroteCurrentEntry)
- {
- throw new ArgumentException("WriteEntryTo or OpenEntryStream can only be called once.");
- }
- var stream = GetEntryStream();
- wroteCurrentEntry = true;
- return stream;
- }
-
- protected virtual EntryStream GetEntryStream()
- {
- return new EntryStream(Entry.Parts.First().GetCompressedStream());
- }
-
- #endregion
-
- IEntry IReader.Entry
- {
- get { return Entry; }
- }
-
- void IExtractionListener.FireCompressedBytesRead(long currentPartCompressedBytes, long compressedReadBytes)
- {
- if (CompressedBytesRead != null)
- {
- CompressedBytesRead(this, new CompressedBytesReadEventArgs()
- {
- CurrentFilePartCompressedBytesRead = currentPartCompressedBytes,
- CompressedBytesRead = compressedReadBytes
- });
- }
- }
-
- void IExtractionListener.FireFilePartExtractionBegin(string name, long size, long compressedSize)
- {
- if (FilePartExtractionBegin != null)
- {
- FilePartExtractionBegin(this, new FilePartExtractionBeginEventArgs()
- {
- CompressedSize = compressedSize,
- Size = size,
- Name = name,
- });
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.IO;
-using SharpCompress.Common;
-
-namespace SharpCompress.Reader
-{
- internal static class IReaderExtensions
- {
-#if !PORTABLE && !NETFX_CORE
- public static void WriteEntryTo(this IReader reader, string filePath)
- {
- using (Stream stream = File.Open(filePath, FileMode.Create, FileAccess.Write))
- {
- reader.WriteEntryTo(stream);
- }
- }
-
- public static void WriteEntryTo(this IReader reader, FileInfo filePath)
- {
- using (Stream stream = filePath.Open(FileMode.Create))
- {
- reader.WriteEntryTo(stream);
- }
- }
-
- /// <summary>
- /// Extract all remaining unread entries to specific directory, retaining filename
- /// </summary>
- public static void WriteAllToDirectory(this IReader reader, string destinationDirectory,
- ExtractOptions options = ExtractOptions.Overwrite)
- {
- while (reader.MoveToNextEntry())
- {
- reader.WriteEntryToDirectory(destinationDirectory, options);
- }
- }
-
- /// <summary>
- /// Extract to specific directory, retaining filename
- /// </summary>
- public static void WriteEntryToDirectory(this IReader reader, string destinationDirectory,
- ExtractOptions options = ExtractOptions.Overwrite)
- {
- string destinationFileName = string.Empty;
- string file = Path.GetFileName(reader.Entry.Key);
-
-
- if (options.HasFlag(ExtractOptions.ExtractFullPath))
- {
- string folder = Path.GetDirectoryName(reader.Entry.Key);
- string destdir = Path.Combine(destinationDirectory, folder);
- if (!Directory.Exists(destdir))
- {
- Directory.CreateDirectory(destdir);
- }
- destinationFileName = Path.Combine(destdir, file);
- }
- else
- {
- destinationFileName = Path.Combine(destinationDirectory, file);
- }
-
- if (!reader.Entry.IsDirectory)
- {
- reader.WriteEntryToFile(destinationFileName, options);
- }
- else if (options.HasFlag(ExtractOptions.ExtractFullPath) && !Directory.Exists(destinationFileName))
- {
- Directory.CreateDirectory(destinationFileName);
- }
- }
-
- /// <summary>
- /// Extract to specific file
- /// </summary>
- public static void WriteEntryToFile(this IReader reader, string destinationFileName,
- ExtractOptions options = ExtractOptions.Overwrite)
- {
- FileMode fm = FileMode.Create;
-
- if (!options.HasFlag(ExtractOptions.Overwrite))
- {
- fm = FileMode.CreateNew;
- }
- using (FileStream fs = File.Open(destinationFileName, fm))
- {
- reader.WriteEntryTo(fs);
- //using (Stream s = reader.OpenEntryStream())
- //{
- // s.TransferTo(fs);
- //}
- }
- }
-#endif
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using SharpCompress.Common;
-
-namespace SharpCompress.Reader
-{
- internal interface IReader : IDisposable
- {
- event EventHandler<CompressedBytesReadEventArgs> CompressedBytesRead;
- event EventHandler<FilePartExtractionBeginEventArgs> FilePartExtractionBegin;
-
- ArchiveType ArchiveType { get; }
-
- IEntry Entry { get; }
-
- /// <summary>
- /// Decompresses the current entry to the stream. This cannot be called twice for the current entry.
- /// </summary>
- /// <param name="writableStream"></param>
- void WriteEntryTo(Stream writableStream);
-
- /// <summary>
- /// Moves to the next entry by reading more data from the underlying stream. This skips if data has not been read.
- /// </summary>
- /// <returns></returns>
- bool MoveToNextEntry();
-
- /// <summary>
- /// Opens the current entry as a stream that will decompress as it is read.
- /// Read the entire stream or use SkipEntry on EntryStream.
- /// </summary>
- EntryStream OpenEntryStream();
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-#if GZIP
-using SharpCompress.Archive.GZip;
-#endif
-#if RAR
-using SharpCompress.Archive.Rar;
-#endif
-#if TAR
-using SharpCompress.Archive.Tar;
-#endif
-using SharpCompress.Archive.Zip;
-using SharpCompress.Common;
-using SharpCompress.Compressor;
-#if BZIP2
-using SharpCompress.Compressor.BZip2;
-#endif
-using SharpCompress.IO;
-#if GZIP
-using SharpCompress.Reader.GZip;
-#endif
-#if RAR
-using SharpCompress.Reader.Rar;
-#endif
-#if TAR
-using SharpCompress.Reader.Tar;
-#endif
-using SharpCompress.Reader.Zip;
-#if DEFLATE
-using GZipStream = SharpCompress.Compressor.Deflate.GZipStream;
-#endif
-
-namespace SharpCompress.Reader
-{
- internal static class ReaderFactory
- {
- /// <summary>
- /// Opens a Reader for Non-seeking usage
- /// </summary>
- /// <param name="stream"></param>
- /// <param name="options"></param>
- /// <returns></returns>
- public static IReader Open(Stream stream, Options options = Options.KeepStreamsOpen)
- {
- stream.CheckNotNull("stream");
-
- RewindableStream rewindableStream = new RewindableStream(stream);
- rewindableStream.StartRecording();
- if (ZipArchive.IsZipFile(rewindableStream, null))
- {
- rewindableStream.Rewind(true);
- return ZipReader.Open(rewindableStream, null, options);
- }
-#if GZIP
- rewindableStream.Rewind(false);
- if (GZipArchive.IsGZipFile(rewindableStream))
- {
- rewindableStream.Rewind(false);
- GZipStream testStream = new GZipStream(rewindableStream, CompressionMode.Decompress);
- if (TarArchive.IsTarFile(testStream))
- {
- rewindableStream.Rewind(true);
- return new TarReader(rewindableStream, CompressionType.GZip, options);
- }
- rewindableStream.Rewind(true);
- return GZipReader.Open(rewindableStream, options);
- }
-#endif
-
-#if BZIP2
- rewindableStream.Rewind(false);
- if (BZip2Stream.IsBZip2(rewindableStream))
- {
- rewindableStream.Rewind(false);
- BZip2Stream testStream = new BZip2Stream(rewindableStream, CompressionMode.Decompress, false);
-#if TAR
- if (TarArchive.IsTarFile(testStream))
- {
- rewindableStream.Rewind(true);
- return new TarReader(rewindableStream, CompressionType.BZip2, options);
- }
-#endif
- }
-#endif
-
-#if TAR
- rewindableStream.Rewind(false);
- if (TarArchive.IsTarFile(rewindableStream))
- {
- rewindableStream.Rewind(true);
- return TarReader.Open(rewindableStream, options);
- }
-#endif
-#if RAR
- rewindableStream.Rewind(false);
- if (RarArchive.IsRarFile(rewindableStream, options))
- {
- rewindableStream.Rewind(true);
- return RarReader.Open(rewindableStream, options);
- }
-#endif
-
- throw new InvalidOperationException("Cannot determine compressed stream type. Supported Reader Formats: Zip, GZip, BZip2, Tar, Rar");
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System.Collections.Generic;
-using System.IO;
-using SharpCompress.Common;
-using SharpCompress.Common.Zip;
-using SharpCompress.Common.Zip.Headers;
-
-namespace SharpCompress.Reader.Zip
-{
- internal class ZipReader : AbstractReader<ZipEntry, ZipVolume>
- {
- private readonly StreamingZipHeaderFactory headerFactory;
- private readonly ZipVolume volume;
-
- internal ZipReader(Stream stream, Options options, string password)
- : base(options, ArchiveType.Zip)
- {
- volume = new ZipVolume(stream, options);
- headerFactory = new StreamingZipHeaderFactory(password);
- }
-
- public override ZipVolume Volume
- {
- get { return volume; }
- }
-
- #region Open
-
- /// <summary>
- /// Opens a ZipReader for Non-seeking usage with a single volume
- /// </summary>
- /// <param name="stream"></param>
- /// <param name="options"></param>
- /// <param name="password"></param>
- /// <returns></returns>
- public static ZipReader Open(Stream stream, string password = null,
- Options options = Options.KeepStreamsOpen)
- {
- stream.CheckNotNull("stream");
- return new ZipReader(stream, options, password);
- }
-
- #endregion
-
- internal override IEnumerable<ZipEntry> GetEntries(Stream stream)
- {
- foreach (ZipHeader h in headerFactory.ReadStreamHeader(stream))
- {
- if (h != null)
- {
- switch (h.ZipHeaderType)
- {
- case ZipHeaderType.LocalEntry:
- {
- yield return new ZipEntry(new StreamingZipFilePart(h as LocalEntryHeader,
- stream));
- }
- break;
- case ZipHeaderType.DirectoryEnd:
- {
- yield break;
- }
- }
- }
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using SharpCompress.Archive;
-using SharpCompress.Common;
-using SharpCompress.IO;
-
-namespace SharpCompress
-{
- internal static class Utility
- {
- public static ReadOnlyCollection<T> ToReadOnly<T>(this IEnumerable<T> items)
- {
- return new ReadOnlyCollection<T>(items.ToList());
- }
-
- /// <summary>
- /// Performs an unsigned bitwise right shift with the specified number
- /// </summary>
- /// <param name="number">Number to operate on</param>
- /// <param name="bits">Ammount of bits to shift</param>
- /// <returns>The resulting number from the shift operation</returns>
- public static int URShift(int number, int bits)
- {
- if (number >= 0)
- return number >> bits;
- else
- return (number >> bits) + (2 << ~bits);
- }
-
- /// <summary>
- /// Performs an unsigned bitwise right shift with the specified number
- /// </summary>
- /// <param name="number">Number to operate on</param>
- /// <param name="bits">Ammount of bits to shift</param>
- /// <returns>The resulting number from the shift operation</returns>
- public static int URShift(int number, long bits)
- {
- return URShift(number, (int)bits);
- }
-
- /// <summary>
- /// Performs an unsigned bitwise right shift with the specified number
- /// </summary>
- /// <param name="number">Number to operate on</param>
- /// <param name="bits">Ammount of bits to shift</param>
- /// <returns>The resulting number from the shift operation</returns>
- public static long URShift(long number, int bits)
- {
- if (number >= 0)
- return number >> bits;
- else
- return (number >> bits) + (2L << ~bits);
- }
-
- /// <summary>
- /// Performs an unsigned bitwise right shift with the specified number
- /// </summary>
- /// <param name="number">Number to operate on</param>
- /// <param name="bits">Ammount of bits to shift</param>
- /// <returns>The resulting number from the shift operation</returns>
- public static long URShift(long number, long bits)
- {
- return URShift(number, (int)bits);
- }
-
- /// <summary>
- /// Fills the array with an specific value from an specific index to an specific index.
- /// </summary>
- /// <param name="array">The array to be filled.</param>
- /// <param name="fromindex">The first index to be filled.</param>
- /// <param name="toindex">The last index to be filled.</param>
- /// <param name="val">The value to fill the array with.</param>
- public static void Fill<T>(T[] array, int fromindex, int toindex, T val) where T : struct
- {
- if (array.Length == 0)
- {
- throw new NullReferenceException();
- }
- if (fromindex > toindex)
- {
- throw new ArgumentException();
- }
- if ((fromindex < 0) || ((System.Array)array).Length < toindex)
- {
- throw new IndexOutOfRangeException();
- }
- for (int index = (fromindex > 0) ? fromindex-- : fromindex; index < toindex; index++)
- {
- array[index] = val;
- }
- }
-
- /// <summary>
- /// Fills the array with an specific value.
- /// </summary>
- /// <param name="array">The array to be filled.</param>
- /// <param name="val">The value to fill the array with.</param>
- public static void Fill<T>(T[] array, T val) where T : struct
- {
- Fill(array, 0, array.Length, val);
- }
-
- public static void SetSize(this List<byte> list, int count)
- {
- if (count > list.Count)
- {
- for (int i = list.Count; i < count; i++)
- {
- list.Add(0x0);
- }
- }
- else
- {
- byte[] temp = new byte[count];
- list.CopyTo(temp, 0);
- list.Clear();
- list.AddRange(temp);
- }
- }
-
- /// <summary> Read a int value from the byte array at the given position (Big Endian)
- ///
- /// </summary>
- /// <param name="array">the array to read from
- /// </param>
- /// <param name="pos">the offset
- /// </param>
- /// <returns> the value
- /// </returns>
- public static int readIntBigEndian(byte[] array, int pos)
- {
- int temp = 0;
- temp |= array[pos] & 0xff;
- temp <<= 8;
- temp |= array[pos + 1] & 0xff;
- temp <<= 8;
- temp |= array[pos + 2] & 0xff;
- temp <<= 8;
- temp |= array[pos + 3] & 0xff;
- return temp;
- }
-
- /// <summary> Read a short value from the byte array at the given position (little
- /// Endian)
- ///
- /// </summary>
- /// <param name="array">the array to read from
- /// </param>
- /// <param name="pos">the offset
- /// </param>
- /// <returns> the value
- /// </returns>
- public static short readShortLittleEndian(byte[] array, int pos)
- {
- return BitConverter.ToInt16(array, pos);
- }
-
- /// <summary> Read an int value from the byte array at the given position (little
- /// Endian)
- ///
- /// </summary>
- /// <param name="array">the array to read from
- /// </param>
- /// <param name="pos">the offset
- /// </param>
- /// <returns> the value
- /// </returns>
- public static int readIntLittleEndian(byte[] array, int pos)
- {
- return BitConverter.ToInt32(array, pos);
- }
-
- /// <summary> Write an int value into the byte array at the given position (Big endian)
- ///
- /// </summary>
- /// <param name="array">the array
- /// </param>
- /// <param name="pos">the offset
- /// </param>
- /// <param name="value">the value to write
- /// </param>
- public static void writeIntBigEndian(byte[] array, int pos, int value)
- {
- array[pos] = (byte)((Utility.URShift(value, 24)) & 0xff);
- array[pos + 1] = (byte)((Utility.URShift(value, 16)) & 0xff);
- array[pos + 2] = (byte)((Utility.URShift(value, 8)) & 0xff);
- array[pos + 3] = (byte)((value) & 0xff);
- }
-
- /// <summary> Write a short value into the byte array at the given position (little
- /// endian)
- ///
- /// </summary>
- /// <param name="array">the array
- /// </param>
- /// <param name="pos">the offset
- /// </param>
- /// <param name="value">the value to write
- /// </param>
-#if PORTABLE || NETFX_CORE
- public static void WriteLittleEndian(byte[] array, int pos, short value)
- {
- byte[] newBytes = BitConverter.GetBytes(value);
- Array.Copy(newBytes, 0, array, pos, newBytes.Length);
- }
-#else
- public static unsafe void WriteLittleEndian(byte[] array, int pos, short value)
- {
- fixed (byte* numRef = &(array[pos]))
- {
- *((short*)numRef) = value;
- }
- }
-#endif
-
- /// <summary> Increment a short value at the specified position by the specified amount
- /// (little endian).
- /// </summary>
- public static void incShortLittleEndian(byte[] array, int pos, short incrementValue)
- {
- short existingValue = BitConverter.ToInt16(array, pos);
- existingValue += incrementValue;
- WriteLittleEndian(array, pos, existingValue);
- //int c = Utility.URShift(((array[pos] & 0xff) + (dv & 0xff)), 8);
- //array[pos] = (byte)(array[pos] + (dv & 0xff));
- //if ((c > 0) || ((dv & 0xff00) != 0))
- //{
- // array[pos + 1] = (byte)(array[pos + 1] + ((Utility.URShift(dv, 8)) & 0xff) + c);
- //}
- }
-
- /// <summary> Write an int value into the byte array at the given position (little
- /// endian)
- ///
- /// </summary>
- /// <param name="array">the array
- /// </param>
- /// <param name="pos">the offset
- /// </param>
- /// <param name="value">the value to write
- /// </param>
-#if PORTABLE || NETFX_CORE
- public static void WriteLittleEndian(byte[] array, int pos, int value)
- {
- byte[] newBytes = BitConverter.GetBytes(value);
- Array.Copy(newBytes, 0, array, pos, newBytes.Length);
- }
-#else
- public static unsafe void WriteLittleEndian(byte[] array, int pos, int value)
- {
- fixed (byte* numRef = &(array[pos]))
- {
- *((int*)numRef) = value;
- }
- }
-#endif
-
- public static void Initialize<T>(this T[] array, Func<T> func)
- {
- for (int i = 0; i < array.Length; i++)
- {
- array[i] = func();
- }
- }
-
- public static void AddRange<T>(this ICollection<T> destination, IEnumerable<T> source)
- {
- foreach (T item in source)
- {
- destination.Add(item);
- }
- }
-
- public static void ForEach<T>(this IEnumerable<T> items, Action<T> action)
- {
- foreach (T item in items)
- {
- action(item);
- }
- }
-
- public static IEnumerable<T> AsEnumerable<T>(this T item)
- {
- yield return item;
- }
-
- public static void CheckNotNull(this object obj, string name)
- {
- if (obj == null)
- {
- throw new ArgumentNullException(name);
- }
- }
-
- public static void CheckNotNullOrEmpty(this string obj, string name)
- {
- obj.CheckNotNull(name);
- if (obj.Length == 0)
- {
- throw new ArgumentException("String is empty.");
- }
- }
-
- public static void Skip(this Stream source, long advanceAmount)
- {
- byte[] buffer = new byte[32 * 1024];
- int read = 0;
- int readCount = 0;
- do
- {
- readCount = buffer.Length;
- if (readCount > advanceAmount)
- {
- readCount = (int)advanceAmount;
- }
- read = source.Read(buffer, 0, readCount);
- if (read < 0)
- {
- break;
- }
- advanceAmount -= read;
- if (advanceAmount == 0)
- {
- break;
- }
- } while (true);
- }
-
- public static void SkipAll(this Stream source)
- {
- byte[] buffer = new byte[32 * 1024];
- do
- {
- } while (source.Read(buffer, 0, buffer.Length) == buffer.Length);
- }
-
-
- public static byte[] UInt32ToBigEndianBytes(uint x)
- {
- return new byte[]
- {
- (byte) ((x >> 24) & 0xff),
- (byte) ((x >> 16) & 0xff),
- (byte) ((x >> 8) & 0xff),
- (byte) (x & 0xff)
- };
- }
-
- public static DateTime DosDateToDateTime(UInt16 iDate, UInt16 iTime)
- {
- int year = iDate / 512 + 1980;
- int month = iDate % 512 / 32;
- int day = iDate % 512 % 32;
- int hour = iTime / 2048;
- int minute = iTime % 2048 / 32;
- int second = iTime % 2048 % 32 * 2;
-
- if (iDate == UInt16.MaxValue || month == 0 || day == 0)
- {
- year = 1980;
- month = 1;
- day = 1;
- }
-
- if (iTime == UInt16.MaxValue)
- {
- hour = minute = second = 0;
- }
-
- DateTime dt;
- try
- {
- dt = new DateTime(year, month, day, hour, minute, second);
- }
- catch
- {
- dt = new DateTime();
- }
- return dt;
- }
-
- public static uint DateTimeToDosTime(this DateTime? dateTime)
- {
- if (dateTime == null)
- {
- return 0;
- }
- return (uint)(
- (dateTime.Value.Second / 2) | (dateTime.Value.Minute << 5) | (dateTime.Value.Hour << 11) |
- (dateTime.Value.Day << 16) | (dateTime.Value.Month << 21) |
- ((dateTime.Value.Year - 1980) << 25));
- }
-
-
- public static DateTime DosDateToDateTime(UInt32 iTime)
- {
- return DosDateToDateTime((UInt16)(iTime / 65536),
- (UInt16)(iTime % 65536));
- }
-
- public static DateTime DosDateToDateTime(Int32 iTime)
- {
- return DosDateToDateTime((UInt32)iTime);
- }
-
- public static long TransferTo(this Stream source, Stream destination)
- {
- byte[] array = new byte[81920];
- int count;
- long total = 0;
- while ((count = source.Read(array, 0, array.Length)) != 0)
- {
- total += count;
- destination.Write(array, 0, count);
- }
- return total;
- }
-
- public static bool ReadFully(this Stream stream, byte[] buffer)
- {
- int total = 0;
- int read;
- while ((read = stream.Read(buffer, total, buffer.Length - total)) > 0)
- {
- total += read;
- if (total >= buffer.Length)
- {
- return true;
- }
- }
- return (total >= buffer.Length);
- }
-
- public static string TrimNulls(this string source)
- {
- return source.Replace('\0', ' ').Trim();
- }
-
- public static bool BinaryEquals(this byte[] source, byte[] target)
- {
- if (source.Length != target.Length)
- {
- return false;
- }
- for (int i = 0; i < source.Length; ++i)
- {
- if (source[i] != target[i])
- {
- return false;
- }
- }
- return true;
- }
-
-#if PORTABLE || NETFX_CORE
- public static void CopyTo(this byte[] array, byte[] destination, int index)
- {
- Array.Copy(array, 0, destination, index, array.Length);
- }
-
- public static long HostToNetworkOrder(long host)
- {
- return (int)((long)HostToNetworkOrder((int)host)
- & unchecked((long)(unchecked((ulong)-1))) << 32
- | ((long)HostToNetworkOrder((int)((int)host >> 32)) & unchecked((long)(unchecked((ulong)-1)))));
- }
- public static int HostToNetworkOrder(int host)
- {
- return (int)((int)(HostToNetworkOrder((short)host) & -1) << 16 | (HostToNetworkOrder((short)(host >> 16)) & -1));
- }
- public static short HostToNetworkOrder(short host)
- {
- return (short)((int)(host & 255) << 8 | ((int)host >> 8 & 255));
- }
- public static long NetworkToHostOrder(long network)
- {
- return HostToNetworkOrder(network);
- }
- public static int NetworkToHostOrder(int network)
- {
- return HostToNetworkOrder(network);
- }
- public static short NetworkToHostOrder(short network)
- {
- return HostToNetworkOrder(network);
- }
-#endif
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using SharpCompress.Common;
-
-namespace SharpCompress.Writer
-{
- internal abstract class AbstractWriter : IWriter
- {
- private bool closeStream;
- private bool isDisposed;
-
- protected AbstractWriter(ArchiveType type)
- {
- this.WriterType = type;
- }
-
- protected void InitalizeStream(Stream stream, bool closeStream)
- {
- this.OutputStream = stream;
- this.closeStream = closeStream;
- }
-
- protected Stream OutputStream { get; private set; }
-
- public ArchiveType WriterType { get; private set; }
-
- public abstract void Write(string filename, System.IO.Stream source, DateTime? modificationTime);
-
- protected virtual void Dispose(bool isDisposing)
- {
- if (isDisposing && closeStream)
- {
- OutputStream.Dispose();
- }
- }
-
- public void Dispose()
- {
- if (!isDisposed)
- {
- GC.SuppressFinalize(this);
- Dispose(true);
- isDisposed = true;
- }
- }
-
- ~AbstractWriter()
- {
- if (!isDisposed)
- {
- Dispose(false);
- isDisposed = true;
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-
-namespace SharpCompress.Writer
-{
- internal static class IWriterExtensions
- {
- public static void Write(this IWriter writer, string entryPath, Stream source)
- {
- writer.Write(entryPath, source, null);
- }
-
-#if !PORTABLE && !NETFX_CORE
- public static void Write(this IWriter writer, string entryPath, FileInfo source)
- {
- if (!source.Exists)
- {
- throw new ArgumentException("Source does not exist: " + source.FullName);
- }
- using (var stream = source.OpenRead())
- {
- writer.Write(entryPath, stream, source.LastWriteTime);
- }
- }
-
- public static void Write(this IWriter writer, string entryPath, string source)
- {
- writer.Write(entryPath, new FileInfo(source));
- }
-
- public static void WriteAll(this IWriter writer, string directory, string searchPattern = "*",
- SearchOption option = SearchOption.TopDirectoryOnly)
- {
- if (!Directory.Exists(directory))
- {
- throw new ArgumentException("Directory does not exist: " + directory);
- }
-#if NET2
- foreach (var file in Directory.GetFiles(directory, searchPattern, option))
-#else
- foreach (var file in Directory.EnumerateFiles(directory, searchPattern, option))
-#endif
- {
- writer.Write(file.Substring(directory.Length), file);
- }
- }
-#endif
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using SharpCompress.Common;
-
-namespace SharpCompress.Writer
-{
- internal interface IWriter : IDisposable
- {
- ArchiveType WriterType { get; }
- void Write(string filename, Stream source, DateTime? modificationTime);
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using SharpCompress.Common;
-#if GZIP
-using SharpCompress.Writer.GZip;
-#endif
-#if TAR
-using SharpCompress.Writer.Tar;
-#endif
-using SharpCompress.Writer.Zip;
-
-namespace SharpCompress.Writer
-{
- internal static class WriterFactory
- {
- public static IWriter Open(Stream stream, ArchiveType archiveType, CompressionType compressionType)
- {
- return Open(stream, archiveType, new CompressionInfo
- {
- Type = compressionType
- });
- }
-
- public static IWriter Open(Stream stream, ArchiveType archiveType, CompressionInfo compressionInfo)
- {
- switch (archiveType)
- {
-#if GZIP
- case ArchiveType.GZip:
- {
- if (compressionInfo.Type != CompressionType.GZip)
- {
- throw new InvalidFormatException("GZip archives only support GZip compression type.");
- }
- return new GZipWriter(stream);
- }
-#endif
- case ArchiveType.Zip:
- {
- return new ZipWriter(stream, compressionInfo, null);
- }
-#if TAR
- case ArchiveType.Tar:
- {
- return new TarWriter(stream, compressionInfo);
- }
-#endif
- default:
- {
- throw new NotSupportedException("Archive Type does not have a Writer: " + archiveType);
- }
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.IO;
-using System.Text;
-using SharpCompress.Common.Zip;
-using SharpCompress.Common.Zip.Headers;
-
-namespace SharpCompress.Writer.Zip
-{
- internal class ZipCentralDirectoryEntry
- {
- internal string FileName { get; set; }
- internal DateTime? ModificationTime { get; set; }
- internal string Comment { get; set; }
- internal uint Crc { get; set; }
- internal uint HeaderOffset { get; set; }
- internal uint Compressed { get; set; }
- internal uint Decompressed { get; set; }
-
-
- internal uint Write(Stream outputStream, ZipCompressionMethod compression)
- {
- byte[] encodedFilename = Encoding.UTF8.GetBytes(FileName);
- byte[] encodedComment = Encoding.UTF8.GetBytes(Comment);
-
- outputStream.Write(new byte[] {80, 75, 1, 2, 0x14, 0, 0x14, 0}, 0, 8);
- HeaderFlags flags = HeaderFlags.UTF8;
- if (!outputStream.CanSeek)
- {
- flags |= HeaderFlags.UsePostDataDescriptor;
- if (compression == ZipCompressionMethod.LZMA)
- {
- flags |= HeaderFlags.Bit1; // eos marker
- }
- }
- outputStream.Write(BitConverter.GetBytes((ushort) flags), 0, 2);
- outputStream.Write(BitConverter.GetBytes((ushort) compression), 0, 2); // zipping method
- outputStream.Write(BitConverter.GetBytes(ModificationTime.DateTimeToDosTime()), 0, 4);
- // zipping date and time
- outputStream.Write(BitConverter.GetBytes(Crc), 0, 4); // file CRC
- outputStream.Write(BitConverter.GetBytes(Compressed), 0, 4); // compressed file size
- outputStream.Write(BitConverter.GetBytes(Decompressed), 0, 4); // uncompressed file size
- outputStream.Write(BitConverter.GetBytes((ushort) encodedFilename.Length), 0, 2); // Filename in zip
- outputStream.Write(BitConverter.GetBytes((ushort) 0), 0, 2); // extra length
- outputStream.Write(BitConverter.GetBytes((ushort) encodedComment.Length), 0, 2);
-
- outputStream.Write(BitConverter.GetBytes((ushort) 0), 0, 2); // disk=0
- outputStream.Write(BitConverter.GetBytes((ushort) 0), 0, 2); // file type: binary
- outputStream.Write(BitConverter.GetBytes((ushort) 0), 0, 2); // Internal file attributes
- outputStream.Write(BitConverter.GetBytes((ushort) 0x8100), 0, 2);
- // External file attributes (normal/readable)
- outputStream.Write(BitConverter.GetBytes(HeaderOffset), 0, 4); // Offset of header
-
- outputStream.Write(encodedFilename, 0, encodedFilename.Length);
- outputStream.Write(encodedComment, 0, encodedComment.Length);
-
- return (uint) (8 + 2 + 2 + 4 + 4 + 4 + 4 + 2 + 2 + 2
- + 2 + 2 + 2 + 2 + 4 + encodedFilename.Length + encodedComment.Length);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using SharpCompress.Common;
-using SharpCompress.Common.Zip;
-using SharpCompress.Common.Zip.Headers;
-using SharpCompress.Compressor;
-#if BZIP2
-using SharpCompress.Compressor.BZip2;
-#endif
-using SharpCompress.Compressor.Deflate;
-#if LZMA
-using SharpCompress.Compressor.LZMA;
-#endif
-#if PPMd
-using SharpCompress.Compressor.PPMd;
-#endif
-using SharpCompress.IO;
-#if DEFLATE
-using DeflateStream = SharpCompress.Compressor.Deflate.DeflateStream;
-#endif
-
-namespace SharpCompress.Writer.Zip
-{
- internal class ZipWriter : AbstractWriter
- {
- private readonly ZipCompressionMethod compression;
- private readonly CompressionLevel deflateCompressionLevel;
-
- private readonly List<ZipCentralDirectoryEntry> entries = new List<ZipCentralDirectoryEntry>();
- private readonly string zipComment;
- private readonly Encoding encoding;
- private long streamPosition;
-
-#if PPMd
- private readonly PpmdProperties ppmdProperties; // Caching properties to speed up PPMd.
-#endif
-
- public ZipWriter(Stream destination, CompressionInfo compressionInfo, string zipComment, Encoding encoding = null)
- : base(ArchiveType.Zip)
- {
- this.zipComment = zipComment ?? string.Empty;
- this.encoding = encoding ?? ArchiveEncoding.Default;
-
- switch (compressionInfo.Type)
- {
- case CompressionType.None:
- {
- compression = ZipCompressionMethod.None;
- }
- break;
- case CompressionType.Deflate:
- {
- compression = ZipCompressionMethod.Deflate;
- deflateCompressionLevel = compressionInfo.DeflateCompressionLevel;
- }
- break;
- case CompressionType.BZip2:
- {
- compression = ZipCompressionMethod.BZip2;
- }
- break;
-#if LZMA
- case CompressionType.LZMA:
- {
- compression = ZipCompressionMethod.LZMA;
- }
- break;
-#endif
-#if PPMd
- case CompressionType.PPMd:
- {
- ppmdProperties = new PpmdProperties();
- compression = ZipCompressionMethod.PPMd;
- }
- break;
-#endif
- default:
- throw new InvalidFormatException("Invalid compression method: " + compressionInfo.Type);
- }
- InitalizeStream(destination, false);
- }
-
- protected override void Dispose(bool isDisposing)
- {
- if (isDisposing)
- {
- uint size = 0;
- foreach (ZipCentralDirectoryEntry entry in entries)
- {
- size += entry.Write(OutputStream, compression);
- }
- WriteEndRecord(size);
- }
- base.Dispose(isDisposing);
- }
-
- public override void Write(string entryPath, Stream source, DateTime? modificationTime)
- {
- Write(entryPath, source, modificationTime, null);
- }
-
- public void Write(string entryPath, Stream source, DateTime? modificationTime, string comment)
- {
- using (Stream output = WriteToStream(entryPath, modificationTime, comment))
- {
- source.TransferTo(output);
- }
- }
-
- public Stream WriteToStream(string entryPath, DateTime? modificationTime, string comment)
- {
- entryPath = NormalizeFilename(entryPath);
- modificationTime = modificationTime ?? DateTime.Now;
- comment = comment ?? "";
- var entry = new ZipCentralDirectoryEntry
- {
- Comment = comment,
- FileName = entryPath,
- ModificationTime = modificationTime,
- HeaderOffset = (uint) streamPosition,
- };
- var headersize = (uint) WriteHeader(entryPath, modificationTime);
- streamPosition += headersize;
- return new ZipWritingStream(this, OutputStream, entry);
- }
-
- private string NormalizeFilename(string filename)
- {
- filename = filename.Replace('\\', '/');
-
- int pos = filename.IndexOf(':');
- if (pos >= 0)
- filename = filename.Remove(0, pos + 1);
-
- return filename;
- }
-
- private int WriteHeader(string filename, DateTime? modificationTime)
- {
- byte[] encodedFilename = encoding.GetBytes(filename);
-
- OutputStream.Write(BitConverter.GetBytes(ZipHeaderFactory.ENTRY_HEADER_BYTES), 0, 4);
- OutputStream.Write(new byte[] {20, 0}, 0, 2); //version
- HeaderFlags flags = encoding == Encoding.UTF8 ? HeaderFlags.UTF8 : (HeaderFlags)0;
- if (!OutputStream.CanSeek)
- {
- flags |= HeaderFlags.UsePostDataDescriptor;
- if (compression == ZipCompressionMethod.LZMA)
- {
- flags |= HeaderFlags.Bit1; // eos marker
- }
- }
- OutputStream.Write(BitConverter.GetBytes((ushort) flags), 0, 2);
- OutputStream.Write(BitConverter.GetBytes((ushort) compression), 0, 2); // zipping method
- OutputStream.Write(BitConverter.GetBytes(modificationTime.DateTimeToDosTime()), 0, 4);
- // zipping date and time
- OutputStream.Write(new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 12);
- // unused CRC, un/compressed size, updated later
- OutputStream.Write(BitConverter.GetBytes((ushort) encodedFilename.Length), 0, 2); // filename length
- OutputStream.Write(BitConverter.GetBytes((ushort) 0), 0, 2); // extra length
- OutputStream.Write(encodedFilename, 0, encodedFilename.Length);
-
- return 6 + 2 + 2 + 4 + 12 + 2 + 2 + encodedFilename.Length;
- }
-
- private void WriteFooter(uint crc, uint compressed, uint uncompressed)
- {
- OutputStream.Write(BitConverter.GetBytes(crc), 0, 4);
- OutputStream.Write(BitConverter.GetBytes(compressed), 0, 4);
- OutputStream.Write(BitConverter.GetBytes(uncompressed), 0, 4);
- }
-
- private void WriteEndRecord(uint size)
- {
- byte[] encodedComment = encoding.GetBytes(zipComment);
-
- OutputStream.Write(new byte[] {80, 75, 5, 6, 0, 0, 0, 0}, 0, 8);
- OutputStream.Write(BitConverter.GetBytes((ushort) entries.Count), 0, 2);
- OutputStream.Write(BitConverter.GetBytes((ushort) entries.Count), 0, 2);
- OutputStream.Write(BitConverter.GetBytes(size), 0, 4);
- OutputStream.Write(BitConverter.GetBytes((uint) streamPosition), 0, 4);
- OutputStream.Write(BitConverter.GetBytes((ushort) encodedComment.Length), 0, 2);
- OutputStream.Write(encodedComment, 0, encodedComment.Length);
- }
-
- #region Nested type: ZipWritingStream
-
- internal class ZipWritingStream : Stream
- {
- private readonly CRC32 crc = new CRC32();
- private readonly ZipCentralDirectoryEntry entry;
- private readonly Stream originalStream;
- private readonly Stream writeStream;
- private readonly ZipWriter writer;
- private CountingWritableSubStream counting;
- private uint decompressed;
-
- internal ZipWritingStream(ZipWriter writer, Stream originalStream, ZipCentralDirectoryEntry entry)
- {
- this.writer = writer;
- this.originalStream = originalStream;
- writeStream = GetWriteStream(originalStream);
- this.writer = writer;
- this.entry = entry;
- }
-
- public override bool CanRead
- {
- get { return false; }
- }
-
- public override bool CanSeek
- {
- get { return false; }
- }
-
- public override bool CanWrite
- {
- get { return true; }
- }
-
- public override long Length
- {
- get { throw new NotSupportedException(); }
- }
-
- public override long Position
- {
- get { throw new NotSupportedException(); }
- set { throw new NotSupportedException(); }
- }
-
- private Stream GetWriteStream(Stream writeStream)
- {
- counting = new CountingWritableSubStream(writeStream);
- Stream output = counting;
- switch (writer.compression)
- {
- case ZipCompressionMethod.None:
- {
- return output;
- }
- case ZipCompressionMethod.Deflate:
- {
- return new System.IO.Compression.DeflateStream(counting,
- System.IO.Compression.CompressionMode.Compress, true);
- }
-#if BZIP2
- case ZipCompressionMethod.BZip2:
- {
- return new BZip2Stream(counting, CompressionMode.Compress, true);
- }
-#endif
-#if LZMA
- case ZipCompressionMethod.LZMA:
- {
- counting.WriteByte(9);
- counting.WriteByte(20);
- counting.WriteByte(5);
- counting.WriteByte(0);
-
- LzmaStream lzmaStream = new LzmaStream(new LzmaEncoderProperties(!originalStream.CanSeek),
- false, counting);
- counting.Write(lzmaStream.Properties, 0, lzmaStream.Properties.Length);
- return lzmaStream;
- }
-#endif
-#if PPMd
- case ZipCompressionMethod.PPMd:
- {
- counting.Write(writer.ppmdProperties.Properties, 0, 2);
- return new PpmdStream(writer.ppmdProperties, counting, true);
- }
-#endif
- default:
- {
- throw new NotSupportedException("CompressionMethod: " + writer.compression);
- }
- }
- }
-
- protected override void Dispose(bool disposing)
- {
- base.Dispose(disposing);
- if (disposing)
- {
- writeStream.Dispose();
- entry.Crc = (uint) crc.Crc32Result;
- entry.Compressed = counting.Count;
- entry.Decompressed = decompressed;
- if (originalStream.CanSeek)
- {
- originalStream.Position = entry.HeaderOffset + 6;
- originalStream.WriteByte(0);
- originalStream.Position = entry.HeaderOffset + 14;
- writer.WriteFooter(entry.Crc, counting.Count, decompressed);
- originalStream.Position = writer.streamPosition + entry.Compressed;
- writer.streamPosition += entry.Compressed;
- }
- else
- {
- originalStream.Write(BitConverter.GetBytes(ZipHeaderFactory.POST_DATA_DESCRIPTOR), 0, 4);
- writer.WriteFooter(entry.Crc, counting.Count, decompressed);
- writer.streamPosition += entry.Compressed + 16;
- }
- writer.entries.Add(entry);
- }
- }
-
- public override void Flush()
- {
- writeStream.Flush();
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- throw new NotSupportedException();
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new NotSupportedException();
- }
-
- public override void SetLength(long value)
- {
- throw new NotSupportedException();
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- decompressed += (uint) count;
- crc.SlurpBlock(buffer, offset, count);
- writeStream.Write(buffer, offset, count);
- }
- }
-
- #endregion
- }
-}
\ No newline at end of file
<NoStdLib>True</NoStdLib>\r
\r
<NoConfig>True</NoConfig>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
+ \r
<AppDesignerFolder>Properties</AppDesignerFolder>\r
<RootNamespace>\r
</RootNamespace>\r
</PropertyGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<ItemGroup>\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\Crc32Helper.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\BlockType.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\CopyEncoder.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\DeflateInput.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\DeflateManagedStream.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\DeflaterManaged.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\FastEncoder.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\FastEncoderStatus.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\FastEncoderWindow.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\FileFormats.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\HuffmanTree.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\InflaterManaged.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\InflaterState.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\InputBuffer.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\Match.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\MatchState.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\OutputBuffer.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\DeflateManaged\OutputWindow.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\PositionPreservingWriteOnlyStreamWrapper.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\ZipArchive.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\ZipArchiveEntry.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\ZipArchiveMode.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\ZipBlocks.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\ZipCustomStreams.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\ZipHelper.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\ZipVersion.cs" />\r
<Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
+ <Compile Include="..\..\build\common\SR.cs" />\r
<Compile Include="AssemblyInfo.cs" />\r
- <Compile Include="SharpCompress\Archive\AbstractArchive.cs" />\r
- <Compile Include="SharpCompress\Archive\AbstractWritableArchive.cs" />\r
- <Compile Include="SharpCompress\Archive\AbstractWritableArchive.Extensions.cs" />\r
- <Compile Include="SharpCompress\Archive\ArchiveFactory.cs" />\r
- <Compile Include="SharpCompress\Archive\IArchive.cs" />\r
- <Compile Include="SharpCompress\Archive\IArchive.Extensions.cs" />\r
- <Compile Include="SharpCompress\Archive\IArchiveEntry.cs" />\r
- <Compile Include="SharpCompress\Archive\IArchiveEntry.Extensions.cs" />\r
- <Compile Include="SharpCompress\Archive\IArchiveExtractionListener.cs" />\r
- <Compile Include="SharpCompress\Archive\IWritableArchiveEntry.cs" />\r
- <Compile Include="SharpCompress\Archive\Zip\ZipArchive.cs" />\r
- <Compile Include="SharpCompress\Archive\Zip\ZipArchiveEntry.cs" />\r
- <Compile Include="SharpCompress\Archive\Zip\ZipWritableArchiveEntry.cs" />\r
- <Compile Include="SharpCompress\Common\ArchiveEncoding.cs" />\r
- <Compile Include="SharpCompress\Common\ArchiveException.cs" />\r
- <Compile Include="SharpCompress\Common\ArchiveExtractionEventArgs.cs" />\r
- <Compile Include="SharpCompress\Common\ArchiveType.cs" />\r
- <Compile Include="SharpCompress\Common\CompressedBytesReadEventArgs.cs" />\r
- <Compile Include="SharpCompress\Common\CompressionInfo.cs" />\r
- <Compile Include="SharpCompress\Common\CompressionType.cs" />\r
- <Compile Include="SharpCompress\Common\CryptographicException.cs" />\r
- <Compile Include="SharpCompress\Common\Entry.cs" />\r
- <Compile Include="SharpCompress\Common\EntryStream.cs" />\r
- <Compile Include="SharpCompress\Common\ExtractionException.cs" />\r
- <Compile Include="SharpCompress\Common\ExtractOptions.cs" />\r
- <Compile Include="SharpCompress\Common\FilePart.cs" />\r
- <Compile Include="SharpCompress\Common\FilePartExtractionBeginEventArgs.cs" />\r
- <Compile Include="SharpCompress\Common\FlagUtility.cs" />\r
- <Compile Include="SharpCompress\Common\IEntry.cs" />\r
- <Compile Include="SharpCompress\Common\IExtractionListener.cs" />\r
- <Compile Include="SharpCompress\Common\IncompleteArchiveException.cs" />\r
- <Compile Include="SharpCompress\Common\InvalidFormatException.cs" />\r
- <Compile Include="SharpCompress\Common\IVolume.cs" />\r
- <Compile Include="SharpCompress\Common\MultipartStreamRequiredException.cs" />\r
- <Compile Include="SharpCompress\Common\MultiVolumeExtractionException.cs" />\r
- <Compile Include="SharpCompress\Common\Options.cs" />\r
- <Compile Include="SharpCompress\Common\PasswordProtectedException.cs" />\r
- <Compile Include="SharpCompress\Common\Volume.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\Headers\DirectoryEndHeader.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\Headers\DirectoryEntryHeader.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\Headers\HeaderFlags.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\Headers\IgnoreHeader.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\Headers\LocalEntryHeader.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\Headers\SplitHeader.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\Headers\ZipFileEntry..cs" />\r
- <Compile Include="SharpCompress\Common\Zip\Headers\ZipHeader.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\Headers\ZipHeaderType.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\PkwareTraditionalCryptoStream.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\PkwareTraditionalEncryptionData.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\SeekableZipFilePart.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\SeekableZipHeaderFactory.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\StreamingZipFilePart.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\StreamingZipHeaderFactory.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\WinzipAesCryptoStream.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\WinzipAesEncryptionData.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\WinzipAesKeySize.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\ZipCompressionMethod.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\ZipEntry.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\ZipFilePart.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\ZipHeaderFactory.cs" />\r
- <Compile Include="SharpCompress\Common\Zip\ZipVolume.cs" />\r
- <Compile Include="SharpCompress\Compressor\CompressionMode.cs" />\r
- <Compile Include="SharpCompress\Compressor\Deflate\CRC32.cs" />\r
- <Compile Include="SharpCompress\Compressor\Deflate\ZlibBase.cs" />\r
- <Compile Include="SharpCompress\EnumExtensions.cs" />\r
- <Compile Include="SharpCompress\IO\AppendingStream.cs" />\r
- <Compile Include="SharpCompress\IO\CountingWritableSubStream.cs" />\r
- <Compile Include="SharpCompress\IO\ListeningStream.cs" />\r
- <Compile Include="SharpCompress\IO\MarkingBinaryReader.cs" />\r
- <Compile Include="SharpCompress\IO\NonDisposingStream.cs" />\r
- <Compile Include="SharpCompress\IO\ReadOnlySubStream.cs" />\r
- <Compile Include="SharpCompress\IO\RewindableStream.cs" />\r
- <Compile Include="SharpCompress\IO\StreamingMode.cs" />\r
- <Compile Include="SharpCompress\LazyReadOnlyCollection.cs" />\r
- <Compile Include="SharpCompress\Reader\AbstractReader.cs" />\r
- <Compile Include="SharpCompress\Reader\IReader.cs" />\r
- <Compile Include="SharpCompress\Reader\IReader.Extensions.cs" />\r
- <Compile Include="SharpCompress\Reader\ReaderFactory.cs" />\r
- <Compile Include="SharpCompress\Reader\Zip\ZipReader.cs" />\r
- <Compile Include="SharpCompress\ReadOnlyCollection.cs" />\r
- <Compile Include="SharpCompress\Utility.cs" />\r
- <Compile Include="SharpCompress\Writer\AbstractWriter.cs" />\r
- <Compile Include="SharpCompress\Writer\IWriter.cs" />\r
- <Compile Include="SharpCompress\Writer\IWriter.Extensions.cs" />\r
- <Compile Include="SharpCompress\Writer\WriterFactory.cs" />\r
- <Compile Include="SharpCompress\Writer\Zip\ZipCentralDirectoryEntry.cs" />\r
- <Compile Include="SharpCompress\Writer\Zip\ZipWriter.cs" />\r
- <Compile Include="TypeForwarders.cs" />\r
- <Compile Include="ZipArchive.cs" />\r
- <Compile Include="ZipArchiveEntry.cs" />\r
- <Compile Include="ZipArchiveMode.cs" />\r </ItemGroup>\r
+ <Compile Include="corefx\SR.cs" />\r
+ <Compile Include="corefx\ZipArchiveEntry.Mono.cs" />\r
+ <Compile Include="TypeForwarders.cs" />\r </ItemGroup>\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
Other similar extension points exist, see Microsoft.Common.targets.\r
<Target Name="BeforeBuild">\r
<Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
<Name>System-net_4_x</Name>\r
</ProjectReference>\r
- <ProjectReference Include="../System.Core/System.Core-net_4_x.csproj">\r
- <Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
- <Name>System.Core-net_4_x</Name>\r
- </ProjectReference>\r
</ItemGroup>\r
<ItemGroup>\r
<Folder Include="Properties\" />\r
-SharpCompress/EnumExtensions.cs
-SharpCompress/LazyReadOnlyCollection.cs
-SharpCompress/ReadOnlyCollection.cs
-SharpCompress/Utility.cs
-SharpCompress/Archive/AbstractArchive.cs
-SharpCompress/Archive/AbstractWritableArchive.cs
-SharpCompress/Archive/AbstractWritableArchive.Extensions.cs
-SharpCompress/Archive/ArchiveFactory.cs
-SharpCompress/Archive/IArchive.cs
-SharpCompress/Archive/IArchive.Extensions.cs
-SharpCompress/Archive/IArchiveEntry.cs
-SharpCompress/Archive/IArchiveEntry.Extensions.cs
-SharpCompress/Archive/IArchiveExtractionListener.cs
-SharpCompress/Archive/IWritableArchiveEntry.cs
-SharpCompress/Archive/Zip/ZipArchive.cs
-SharpCompress/Archive/Zip/ZipArchiveEntry.cs
-SharpCompress/Archive/Zip/ZipWritableArchiveEntry.cs
-SharpCompress/Common/ArchiveEncoding.cs
-SharpCompress/Common/ArchiveException.cs
-SharpCompress/Common/ArchiveExtractionEventArgs.cs
-SharpCompress/Common/ArchiveType.cs
-SharpCompress/Common/CompressedBytesReadEventArgs.cs
-SharpCompress/Common/CompressionInfo.cs
-SharpCompress/Common/CompressionType.cs
-SharpCompress/Common/CryptographicException.cs
-SharpCompress/Common/Entry.cs
-SharpCompress/Common/EntryStream.cs
-SharpCompress/Common/ExtractionException.cs
-SharpCompress/Common/ExtractOptions.cs
-SharpCompress/Common/FilePart.cs
-SharpCompress/Common/FilePartExtractionBeginEventArgs.cs
-SharpCompress/Common/FlagUtility.cs
-SharpCompress/Common/IEntry.cs
-SharpCompress/Common/IExtractionListener.cs
-SharpCompress/Common/IncompleteArchiveException.cs
-SharpCompress/Common/InvalidFormatException.cs
-SharpCompress/Common/IVolume.cs
-SharpCompress/Common/MultipartStreamRequiredException.cs
-SharpCompress/Common/MultiVolumeExtractionException.cs
-SharpCompress/Common/Options.cs
-SharpCompress/Common/PasswordProtectedException.cs
-SharpCompress/Common/Volume.cs
-SharpCompress/Common/Zip/PkwareTraditionalCryptoStream.cs
-SharpCompress/Common/Zip/PkwareTraditionalEncryptionData.cs
-SharpCompress/Common/Zip/SeekableZipFilePart.cs
-SharpCompress/Common/Zip/SeekableZipHeaderFactory.cs
-SharpCompress/Common/Zip/StreamingZipFilePart.cs
-SharpCompress/Common/Zip/StreamingZipHeaderFactory.cs
-SharpCompress/Common/Zip/WinzipAesCryptoStream.cs
-SharpCompress/Common/Zip/WinzipAesEncryptionData.cs
-SharpCompress/Common/Zip/WinzipAesKeySize.cs
-SharpCompress/Common/Zip/ZipCompressionMethod.cs
-SharpCompress/Common/Zip/ZipEntry.cs
-SharpCompress/Common/Zip/ZipFilePart.cs
-SharpCompress/Common/Zip/ZipHeaderFactory.cs
-SharpCompress/Common/Zip/ZipVolume.cs
-SharpCompress/Common/Zip/Headers/DirectoryEndHeader.cs
-SharpCompress/Common/Zip/Headers/DirectoryEntryHeader.cs
-SharpCompress/Common/Zip/Headers/HeaderFlags.cs
-SharpCompress/Common/Zip/Headers/IgnoreHeader.cs
-SharpCompress/Common/Zip/Headers/LocalEntryHeader.cs
-SharpCompress/Common/Zip/Headers/SplitHeader.cs
-SharpCompress/Common/Zip/Headers/ZipFileEntry..cs
-SharpCompress/Common/Zip/Headers/ZipHeader.cs
-SharpCompress/Common/Zip/Headers/ZipHeaderType.cs
-SharpCompress/Compressor/CompressionMode.cs
-SharpCompress/Compressor/Deflate/CRC32.cs
-SharpCompress/Compressor/Deflate/ZlibBase.cs
-SharpCompress/IO/AppendingStream.cs
-SharpCompress/IO/CountingWritableSubStream.cs
-SharpCompress/IO/ListeningStream.cs
-SharpCompress/IO/MarkingBinaryReader.cs
-SharpCompress/IO/NonDisposingStream.cs
-SharpCompress/IO/ReadOnlySubStream.cs
-SharpCompress/IO/RewindableStream.cs
-SharpCompress/IO/StreamingMode.cs
-SharpCompress/Reader/AbstractReader.cs
-SharpCompress/Reader/IReader.cs
-SharpCompress/Reader/IReader.Extensions.cs
-SharpCompress/Reader/ReaderFactory.cs
-SharpCompress/Reader/Zip/ZipReader.cs
-SharpCompress/Writer/AbstractWriter.cs
-SharpCompress/Writer/IWriter.cs
-SharpCompress/Writer/IWriter.Extensions.cs
-SharpCompress/Writer/WriterFactory.cs
-SharpCompress/Writer/Zip/ZipCentralDirectoryEntry.cs
-SharpCompress/Writer/Zip/ZipWriter.cs
+../../build/common/Consts.cs
+../../build/common/SR.cs
+
AssemblyInfo.cs
TypeForwarders.cs
-ZipArchive.cs
-ZipArchiveEntry.cs
-ZipArchiveMode.cs
-../../build/common/Consts.cs
-../../build/common/MonoTODOAttribute.cs
+
+corefx/ZipArchiveEntry.Mono.cs
+corefx/SR.cs
+
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/Crc32Helper.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/PositionPreservingWriteOnlyStreamWrapper.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/ZipArchive.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/ZipArchiveMode.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/ZipBlocks.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/ZipCustomStreams.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/ZipHelper.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/ZipVersion.cs
+
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/BlockType.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/CopyEncoder.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/DeflateInput.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/DeflateManagedStream.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/DeflaterManaged.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/FastEncoder.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/FastEncoderStatus.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/FastEncoderWindow.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/FileFormats.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/HuffmanTree.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/InflaterManaged.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/InflaterState.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/InputBuffer.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/Match.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/MatchState.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/OutputBuffer.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/DeflateManaged/OutputWindow.cs
Assert.AreEqual(425, stream.Length);
}
- // .NET does not support these in Read mode but we do.
var entry2 = archive.GetEntry("modernhttpclient.nuspec");
using (var stream = entry2.Open())
{
- Assert.AreEqual(857, stream.Length);
+ // .NET does not support these in Read mode
if (mode == ZipArchiveMode.Update)
{
+ Assert.AreEqual(857, stream.Length);
Assert.AreEqual(0, stream.Position);
}
}
+++ /dev/null
-//
-// ZipArchiveEntry.cs
-//
-// Author:
-// Joao Matos <joao.matos@xamarin.com>
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using SharpCompress.Common;
-
-namespace System.IO.Compression
-{
- public class ZipArchive : IDisposable
- {
- internal Stream stream;
- internal readonly bool leaveStreamOpen;
- internal readonly ZipArchiveMode mode;
- internal Encoding entryNameEncoding;
- internal bool disposed;
- internal List<ZipArchiveEntry> entries;
- internal SharpCompress.Archive.Zip.ZipArchive zipFile;
-
- public ZipArchive (Stream stream)
- {
- if (stream == null)
- throw new ArgumentNullException("stream");
-
- this.stream = stream;
- mode = ZipArchiveMode.Read;
- CreateZip(mode);
- }
-
- public ZipArchive (Stream stream, ZipArchiveMode mode)
- {
- if (stream == null)
- throw new ArgumentNullException("stream");
-
- this.stream = stream;
- this.mode = mode;
- CreateZip(mode);
- }
-
- public ZipArchive (Stream stream, ZipArchiveMode mode, bool leaveOpen)
- {
- if (stream == null)
- throw new ArgumentNullException("stream");
-
- this.stream = stream;
- this.mode = mode;
- leaveStreamOpen = leaveOpen;
- CreateZip(mode);
- }
-
- public ZipArchive (Stream stream, ZipArchiveMode mode, bool leaveOpen, Encoding entryNameEncoding)
- {
- if (stream == null)
- throw new ArgumentNullException("stream");
-
- this.stream = stream;
- this.mode = mode;
- leaveStreamOpen = leaveOpen;
- this.entryNameEncoding = entryNameEncoding;
- CreateZip(mode);
- }
-
- private void CreateZip(ZipArchiveMode mode)
- {
- try {
- if (mode != ZipArchiveMode.Read && mode != ZipArchiveMode.Create && mode != ZipArchiveMode.Update)
- throw new ArgumentOutOfRangeException("mode");
-
- // If the mode parameter is set to Read, the stream must support reading.
- if (mode == ZipArchiveMode.Read && !stream.CanRead)
- throw new ArgumentException("Stream must support reading for Read archive mode");
-
- // If the mode parameter is set to Create, the stream must support writing.
- if (mode == ZipArchiveMode.Create && !stream.CanWrite)
- throw new ArgumentException("Stream must support writing for Create archive mode");
-
- // If the mode parameter is set to Update, the stream must support reading, writing, and seeking.
- if (mode == ZipArchiveMode.Update && (!stream.CanRead || !stream.CanWrite || !stream.CanSeek))
- throw new ArgumentException("Stream must support reading, writing and seeking for Update archive mode");
-
- // If the stream is not seekable, then buffer it into memory (same behavior as .NET).
- if (mode == ZipArchiveMode.Read && !stream.CanSeek)
- {
- var memoryStream = new MemoryStream();
- stream.CopyTo(memoryStream);
-
- if (!leaveStreamOpen)
- stream.Dispose();
-
- this.stream = memoryStream;
- }
-
- try {
- zipFile = mode != ZipArchiveMode.Create && stream.Length != 0
- ? SharpCompress.Archive.Zip.ZipArchive.Open(stream)
- : SharpCompress.Archive.Zip.ZipArchive.Create();
- } catch (Exception e) {
- throw new InvalidDataException("The contents of the stream are not in the zip archive format.", e);
- }
-
- entries = new List<ZipArchiveEntry>();
- if (Mode != ZipArchiveMode.Create) {
- foreach (var entry in zipFile.Entries) {
- var zipEntry = new ZipArchiveEntry(this, entry);
- entries.Add(zipEntry);
- }
- }
- }
- catch {
- if (!leaveStreamOpen)
- stream.Dispose();
- throw;
- }
- }
-
- public ReadOnlyCollection<ZipArchiveEntry> Entries {
- get {
- if (disposed)
- throw new ObjectDisposedException("The zip archive has been disposed.");
-
- if (Mode == ZipArchiveMode.Create)
- throw new NotSupportedException("Cannot access entries in Create mode.");
-
- if (zipFile == null)
- throw new InvalidDataException("The zip archive is corrupt, and its entries cannot be retrieved.");
-
- if (entries == null)
- return new ReadOnlyCollection<ZipArchiveEntry>(new List<ZipArchiveEntry>());
-
- return new ReadOnlyCollection<ZipArchiveEntry>(entries);
- }
- }
-
- public ZipArchiveMode Mode {
- get {
- if (disposed)
- throw new ObjectDisposedException("The zip archive has been disposed.");
-
- return mode;
- }
- }
-
- public ZipArchiveEntry CreateEntry (string entryName)
- {
- if (disposed)
- throw new ObjectDisposedException("The zip archive has been disposed.");
-
- return CreateEntry(entryName, CompressionLevel.Optimal);
- }
-
- internal SharpCompress.Archive.Zip.ZipArchiveEntry CreateEntryInternal(string entryName)
- {
- var memoryStream = new MemoryStream();
- var entry = zipFile.AddEntry(entryName, memoryStream);
-
- return entry;
- }
-
- public ZipArchiveEntry CreateEntry (string entryName, CompressionLevel compressionLevel)
- {
- if (disposed)
- throw new ObjectDisposedException("The zip archive has been disposed.");
-
- if (entryName == string.Empty)
- throw new ArgumentException("Entry name cannot be empty.");
-
- if (entryName == null)
- throw new ArgumentNullException("entryName");
-
- if (mode != ZipArchiveMode.Create && mode != ZipArchiveMode.Update)
- throw new NotSupportedException("The zip archive does not support writing.");
-
- if (zipFile == null)
- throw new InvalidDataException("The zip archive is corrupt, and its entries cannot be retrieved.");
-
- var internalEntry = CreateEntryInternal(entryName);
- var archiveEntry = new ZipArchiveEntry(this, internalEntry);
- entries.Add(archiveEntry);
-
- return archiveEntry;
- }
-
- public ZipArchiveEntry GetEntry (string entryName)
- {
- if (disposed)
- throw new ObjectDisposedException("The zip archive has been disposed.");
-
- if (entryName == string.Empty)
- throw new ArgumentException("Entry name cannot be empty.");
-
- if (entryName == null)
- throw new ArgumentNullException("entryName");
-
- if (mode != ZipArchiveMode.Read && mode != ZipArchiveMode.Update)
- throw new NotSupportedException("The zip archive does not support reading.");
-
- if (zipFile == null)
- throw new InvalidDataException("The zip archive is corrupt, and its entries cannot be retrieved.");
-
- return entries.FirstOrDefault(e => e.FullName == entryName);
- }
-
- private void Save()
- {
- if (mode == ZipArchiveMode.Create)
- {
- zipFile.SaveTo(stream, CompressionType.Deflate, entryNameEncoding ?? Encoding.UTF8);
- }
- else {
- using (var newZip = new MemoryStream())
- {
- zipFile.SaveTo(newZip, CompressionType.Deflate, entryNameEncoding ?? Encoding.UTF8);
-
- stream.SetLength(0);
- stream.Position = 0;
- newZip.Position = 0;
- newZip.CopyTo(stream);
- }
- }
- }
-
- internal void RemoveEntryInternal(ZipArchiveEntry entry)
- {
- zipFile.RemoveEntry(entry.entry);
- entries.Remove(entry);
- }
-
- protected virtual void Dispose (bool disposing)
- {
- if (disposed)
- return;
-
- if (mode != ZipArchiveMode.Read)
- Save();
-
- disposed = true;
-
- if (leaveStreamOpen)
- return;
-
- if (stream != null) {
- stream.Dispose();
- stream = null;
- }
- }
-
- public void Dispose ()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
- }
-}
-
+++ /dev/null
-//
-// ZipArchiveEntry.cs
-//
-// Author:
-// Joao Matos <joao.matos@xamarin.com>
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using SharpCompress.Archive;
-
-namespace System.IO.Compression
-{
- internal class ZipArchiveEntryStream : Stream, IDisposable
- {
- private readonly ZipArchiveEntry entry;
- private Stream stream;
-
- public override bool CanRead {
- get {
- return stream.CanRead;
- }
- }
-
- public override bool CanSeek {
- get {
- return entry.Archive.Mode != ZipArchiveMode.Read;
- }
- }
-
- public override bool CanWrite {
- get {
- return entry.Archive.Mode != ZipArchiveMode.Read;
- }
- }
-
- public override long Length {
- get {
- return stream.CanWrite ? stream.Length : entry.Length;
- }
- }
-
- public override long Position {
- get {
- return stream.Position;
- }
- set {
- stream.Position = value;
- }
- }
-
- public ZipArchiveEntryStream(ZipArchiveEntry entry, Stream stream)
- {
- this.entry = entry;
- this.stream = stream;
- }
-
- public override void Flush ()
- {
- stream.Flush();
- }
-
- public override long Seek (long offset, SeekOrigin origin)
- {
- return stream.Seek(offset, origin);
- }
-
- public override void SetLength (long value)
- {
- stream.SetLength(value);
- }
-
- public override int Read (byte[] buffer, int offset, int count)
- {
- return stream.Read(buffer, offset, count);
- }
-
- public override void Write (byte[] buffer, int offset, int count)
- {
- stream.Write(buffer, offset, count);
- }
-
- internal void EnsureWriteable()
- {
- if (entry.Archive.Mode == ZipArchiveMode.Update && !stream.CanWrite)
- {
- // Replace the read-only stream with a writeable memory stream.
- SetWriteable();
- }
- }
-
- internal void SetWriteable()
- {
- var archive = entry.Archive;
-
- var internalEntry = entry.entry;
- var newEntry = archive.CreateEntryInternal(internalEntry.Key);
- var newStream = newEntry.OpenEntryStream();
-
- var openStream = stream;
- openStream.CopyTo(newStream);
- openStream.Dispose();
-
- newStream.Position = 0;
-
- archive.zipFile.RemoveEntry(internalEntry);
- entry.entry = newEntry;
- stream = newStream;
- }
-
- public new void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- base.Dispose();
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- entry.openStream = null;
- stream.Dispose();
- }
- }
- }
-
- public class ZipArchiveEntry
- {
- internal SharpCompress.Archive.Zip.ZipArchiveEntry entry;
- internal ZipArchiveEntryStream openStream;
- private bool wasDeleted;
-
- internal ZipArchiveEntry(ZipArchive archive, SharpCompress.Archive.Zip.ZipArchiveEntry entry)
- {
- if (archive == null)
- throw new ArgumentNullException("archive");
-
- if (entry == null)
- throw new ArgumentNullException("entry");
-
- Archive = archive;
- this.entry = entry;
- }
-
- public ZipArchive Archive {
- get;
- private set;
- }
-
- public long CompressedLength {
- get {
- if (Archive.Mode == ZipArchiveMode.Create)
- throw new InvalidOperationException("Property cannot be retrieved when the mode is set to Create");
-
- return entry.CompressedSize;
- }
- }
-
- public string FullName {
- get { return entry.Key; }
- }
-
- public DateTimeOffset LastWriteTime {
- get { return entry.LastModifiedTime.GetValueOrDefault(); }
- set { entry.LastModifiedTime = value.DateTime; }
- }
-
- public long Length {
- get {
- if (Archive.Mode == ZipArchiveMode.Create)
- throw new InvalidOperationException("Property cannot be retrieved when the mode is set to Create");
-
- return entry.Size;
- }
- }
-
- public string Name {
- get { return Path.GetFileName(entry.Key); }
- }
-
- public void Delete()
- {
- if (Archive.disposed)
- throw new ObjectDisposedException("The zip archive for this entry has been disposed.");
-
- if (Archive.Mode != ZipArchiveMode.Update)
- throw new NotSupportedException("The zip archive for this entry was opened in a mode other than Update.");
-
- if (openStream != null)
- throw new IOException("The entry is already open for reading or writing.");
-
- wasDeleted = true;
- Archive.RemoveEntryInternal(this);
- }
-
- public Stream Open()
- {
- if (Archive.disposed)
- throw new ObjectDisposedException("The zip archive for this entry has been disposed.");
-
- if (openStream != null && Archive.Mode == ZipArchiveMode.Update)
- throw new IOException("The entry is already currently open for writing.");
-
- if (wasDeleted)
- throw new IOException("The entry has been deleted from the archive.");
-
- if (Archive.Mode == ZipArchiveMode.Create && openStream != null)
- throw new IOException("The archive for this entry was opened with the Create mode, and this entry has already been written to.");
-
- var entryStream = entry.OpenEntryStream();
- openStream = new ZipArchiveEntryStream(this, entryStream);
- openStream.EnsureWriteable();
-
- return openStream;
- }
-
- public override string ToString()
- {
- return FullName;
- }
- }
-}
+++ /dev/null
-//
-// ZipArchiveMode.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-namespace System.IO.Compression
-{
- public enum ZipArchiveMode
- {
- Read,
- Create,
- Update
- }
-}
-
--- /dev/null
+//
+// This file was generated by resx2sr tool
+//
+
+partial class SR
+{
+ public const string ArgumentOutOfRange_Enum = "Enum value was out of legal range.";
+ public const string ArgumentOutOfRange_NeedPosNum = "Positive number required.";
+ public const string CannotReadFromDeflateStream = "Reading from the compression stream is not supported.";
+ public const string CannotWriteToDeflateStream = "Writing to the compression stream is not supported.";
+ public const string GenericInvalidData = "Found invalid data while decoding.";
+ public const string InvalidArgumentOffsetCount = "Offset plus count is larger than the length of target array.";
+ public const string InvalidBeginCall = "Only one asynchronous reader or writer is allowed time at one time.";
+ public const string InvalidBlockLength = "Block length does not match with its complement.";
+ public const string InvalidHuffmanData = "Failed to construct a huffman tree using the length array. The stream might be corrupted.";
+ public const string NotSupported = "This operation is not supported.";
+ public const string NotSupported_UnreadableStream = "Stream does not support reading.";
+ public const string NotSupported_UnwritableStream = "Stream does not support writing.";
+ public const string ObjectDisposed_StreamClosed = "Can not access a closed Stream.";
+ public const string UnknownBlockType = "Unknown block type. Stream might be corrupted.";
+ public const string UnknownState = "Decoder is in some unknown state. This might be caused by corrupted data.";
+ public const string ZLibErrorDLLLoadError = "The underlying compression routine could not be loaded correctly.";
+ public const string ZLibErrorInconsistentStream = "The stream state of the underlying compression routine is inconsistent.";
+ public const string ZLibErrorIncorrectInitParameters = "The underlying compression routine received incorrect initialization parameters.";
+ public const string ZLibErrorNotEnoughMemory = "The underlying compression routine could not reserve sufficient memory.";
+ public const string ZLibErrorVersionMismatch = "The version of the underlying compression routine does not match expected version.";
+ public const string ZLibErrorUnexpected = "The underlying compression routine returned an unexpected error code.";
+ public const string CorruptedGZipHeader = "The magic number in GZip header is not correct. Make sure you are passing in a GZip stream.";
+ public const string UnknownCompressionMode = "The compression mode specified in GZip header is unknown.";
+ public const string InvalidCRC = "The CRC in GZip footer does not match the CRC calculated from the decompressed data.";
+ public const string InvalidStreamSize = "The stream size in GZip footer does not match the real stream size.";
+ public const string ArgumentNeedNonNegative = "The argument must be non-negative.";
+ public const string CannotBeEmpty = "String cannot be empty.";
+ public const string CDCorrupt = "Central Directory corrupt.";
+ public const string CentralDirectoryInvalid = "Central Directory is invalid.";
+ public const string CreateInReadMode = "Cannot create entries on an archive opened in read mode.";
+ public const string CreateModeCapabilities = "Cannot use create mode on a non-writable stream.";
+ public const string CreateModeCreateEntryWhileOpen = "Entries cannot be created while previously created entries are still open.";
+ public const string CreateModeWriteOnceAndOneEntryAtATime = "Entries in create mode may only be written to once, and only one entry may be held open at a time.";
+ public const string DateTimeOutOfRange = "The DateTimeOffset specified cannot be converted into a Zip file timestamp.";
+ public const string DeletedEntry = "Cannot modify deleted entry.";
+ public const string DeleteOnlyInUpdate = "Delete can only be used when the archive is in Update mode.";
+ public const string DeleteOpenEntry = "Cannot delete an entry currently open for writing.";
+ public const string EntriesInCreateMode = "Cannot access entries in Create mode.";
+ public const string EntryNameEncodingNotSupported = "The specified entry name encoding is not supported.";
+ public const string EntryNamesTooLong = "Entry names cannot require more than 2^16 bits.";
+ public const string EntryTooLarge = "Entries larger than 4GB are not supported in Update mode.";
+ public const string EOCDNotFound = "End of Central Directory record could not be found.";
+ public const string FieldTooBigCompressedSize = "Compressed Size cannot be held in an Int64.";
+ public const string FieldTooBigLocalHeaderOffset = "Local Header Offset cannot be held in an Int64.";
+ public const string FieldTooBigNumEntries = "Number of Entries cannot be held in an Int64.";
+ public const string FieldTooBigOffsetToCD = "Offset to Central Directory cannot be held in an Int64.";
+ public const string FieldTooBigOffsetToZip64EOCD = "Offset to Zip64 End Of Central Directory record cannot be held in an Int64.";
+ public const string FieldTooBigStartDiskNumber = "Start Disk Number cannot be held in an Int64.";
+ public const string FieldTooBigUncompressedSize = "Uncompressed Size cannot be held in an Int64.";
+ public const string FrozenAfterWrite = "Cannot modify entry in Create mode after entry has been opened for writing.";
+ public const string HiddenStreamName = "A stream from ZipArchiveEntry has been disposed.";
+ public const string LengthAfterWrite = "Length properties are unavailable once an entry has been opened for writing.";
+ public const string LocalFileHeaderCorrupt = "A local file header is corrupt.";
+ public const string NumEntriesWrong = "Number of entries expected in End Of Central Directory does not correspond to number of entries in Central Directory.";
+ public const string OffsetLengthInvalid = "The offset and length parameters are not valid for the array that was given.";
+ public const string ReadingNotSupported = "This stream from ZipArchiveEntry does not support reading.";
+ public const string ReadModeCapabilities = "Cannot use read mode on a non-readable stream.";
+ public const string ReadOnlyArchive = "Cannot modify read-only archive.";
+ public const string SeekingNotSupported = "This stream from ZipArchiveEntry does not support seeking.";
+ public const string SetLengthRequiresSeekingAndWriting = "SetLength requires a stream that supports seeking and writing.";
+ public const string SplitSpanned = "Split or spanned archives are not supported.";
+ public const string UnexpectedEndOfStream = "Zip file corrupt: unexpected end of stream reached.";
+ public const string UnsupportedCompression = "The archive entry was compressed using an unsupported compression method.";
+ public const string UnsupportedCompressionMethod = "The archive entry was compressed using {0} and is not supported.";
+ public const string UpdateModeCapabilities = "Update mode requires a stream with read, write, and seek capabilities.";
+ public const string UpdateModeOneStream = "Entries cannot be opened multiple times in Update mode.";
+ public const string WritingNotSupported = "This stream from ZipArchiveEntry does not support writing.";
+ public const string Zip64EOCDNotWhereExpected = "Zip 64 End of Central Directory Record not where indicated.";
+ public const string Argument_InvalidPathChars = "Illegal characters in path.";
+ public const string FileNameContainsInvalidCharacters = "An entry in the ZipArchive has a path that contains invalid characters.";
+}
--- /dev/null
+using System.Diagnostics;
+
+namespace System.IO.Compression
+{
+ public partial class ZipArchiveEntry
+ {
+ internal static readonly ZipVersionMadeByPlatform CurrentZipPlatform = Path.PathSeparator == '/' ?
+ ZipVersionMadeByPlatform.Unix : ZipVersionMadeByPlatform.Windows;
+
+ internal static string ParseFileName(string path, ZipVersionMadeByPlatform madeByPlatform)
+ {
+ switch (madeByPlatform) {
+ case ZipVersionMadeByPlatform.Windows:
+ return GetFileName_Windows(path);
+ case ZipVersionMadeByPlatform.Unix:
+ return GetFileName_Unix(path);
+ default:
+ return ParseFileName (path, CurrentZipPlatform);
+ }
+ }
+ }
+}
\ No newline at end of file
Test/System/test-uri-props-manual.txt \
Test/System/test-uri-relative-props.txt
+LIB_MCS_FLAGS = -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%) -nowarn:436
+
ifndef NO_MONO_SECURITY
MONO_SECURITY=Mono.Security
MONO_SECURITY_REF=MonoSecurity=Mono.Security
MONO_SECURITY_DLL=$(the_libdir_base)Mono.Security.dll
+EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS
+else
+LIB_MCS_FLAGS += -d:INSIDE_SYSTEM
endif
ifndef MOBILE_PROFILE
TEST_LIB_REFS = System.Drawing $(MONO_SECURITY) System.Data System.Xml System.Core System.Configuration
else
+LIB_MCS_FLAGS += -nowarn:618
TEST_LIB_REFS = $(MONO_SECURITY) System.Data System.Xml System.Core
endif
TEST_MCS_FLAGS += -d:MONO_FEATURE_PROCESS_START
endif
-LIB_MCS_FLAGS = -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%) -nowarn:436
-
ifndef PROFILE_DISABLE_BTLS
ifdef HAVE_BTLS
TXT_RESOURCE_STRINGS = ../referencesource/System/System.txt
-#
-# MOBILE_PROFILE needs SECURITY_DEP
-#
-ifdef MOBILE_PROFILE
-LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635
-else
-EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS
-endif
-
#
# Flags used to build the secxml version of System.
#
endif
EXTRA_DISTFILES = \
+ common.sources \
Test/test-config-file \
Test/System.Security.Cryptography.X509Certificates/pkits/Makefile \
Test/System.Security.Cryptography.X509Certificates/pkits/README \
// Copyright 2015 Xamarin Inc. All rights reserved.
#if SECURITY_DEP
-using System;
+
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+using MSI = MonoSecurity::Mono.Security.Interface;
+#else
using MSI = Mono.Security.Interface;
+#endif
namespace Mono.Net.Security
{
// Copyright 2015 Xamarin Inc. All rights reserved.
#if SECURITY_DEP
-using System;
+
+#if MONO_SECURITY_ALIAS
+extern alias MonoSecurity;
+using MSI = MonoSecurity::Mono.Security.Interface;
+#else
using MSI = Mono.Security.Interface;
+#endif
+
#if MONO_FEATURE_BTLS
using Mono.Btls;
#endif
+using System;
+
namespace Mono.Net.Security
{
static partial class MonoTlsProviderFactory
[MethodImpl (MethodImplOptions.InternalCall)]
internal extern static bool IsBtlsSupported ();
-#endif
static object locker = new object ();
static bool initialized;
- static IMonoTlsProvider defaultProvider;
+ static IMonoTlsProvider defaultProvider;
+#endif
#endregion
#if SECURITY_DEP
#if SECURITY_DEP
readonly IMonoTlsProvider provider;
readonly NetworkStream networkStream;
-#endif
readonly HttpWebRequest request;
- IMonoSslStream sslStream;
- WebExceptionStatus status;
-
internal HttpWebRequest Request {
get { return request; }
}
+ IMonoSslStream sslStream;
+
internal IMonoSslStream SslStream {
get { return sslStream; }
}
+#endif
+
+ WebExceptionStatus status;
internal WebExceptionStatus ExceptionStatus {
get { return status; }
+//
+// MonoPInvokeCallbackAttribute.cs: necessary for AOT ports of Mono
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
using System;
+using System.Diagnostics;
-namespace Mono.Util {
- class MonoPInvokeCallbackAttribute : Attribute {
- public MonoPInvokeCallbackAttribute (Type t) {}
+namespace Mono.Util
+{
+ [Conditional("MONOTOUCH")]
+ [Conditional("FULL_AOT_RUNTIME")]
+ [AttributeUsage (AttributeTargets.Method)]
+ sealed class MonoPInvokeCallbackAttribute : Attribute
+ {
+ public MonoPInvokeCallbackAttribute (Type t) {}
}
}
-
</PropertyGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<ItemGroup>\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionLevel.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionMode.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\GZipStream.cs" />\r
<Compile Include="..\..\build\common\SR.cs" />\r
<Compile Include="..\referencesource\System\compmod\microsoft\win32\safehandles\SafeProcessHandle.cs" />\r
<Compile Include="..\referencesource\System\compmod\system\codedom\CodeArgumentReferenceExpression.cs" />\r
<Compile Include="..\referencesource\System\sys\system\threading\semaphore.cs" />\r
<Compile Include="..\referencesource\System\sys\system\windows\markup\ValueSerializerAttribute.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
+ <Compile Include="corefx\ZLibNative.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeCompiler.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeGenerator.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeProvider.cs" />\r
<Compile Include="Mono.Net.Security\MonoTlsStream.cs" />\r
<Compile Include="Mono.Net.Security\NoReflectionHelper.cs" />\r
<Compile Include="Mono.Net.Security\SystemCertificateValidator.cs" />\r
+ <Compile Include="Mono.Util\MonoPInvokeCallbackAttribute.cs" />\r
<Compile Include="ReferenceSources\AssertWrapper.cs" />\r
<Compile Include="ReferenceSources\AutoWebProxyScriptEngine.cs" />\r
<Compile Include="ReferenceSources\BinaryCompatibility.cs" />\r
<Compile Include="System.Diagnostics\TraceImpl.cs" />\r
<Compile Include="System.Diagnostics\TraceSourceInfo.cs" />\r
<Compile Include="System.Diagnostics\Win32EventLog.cs" />\r
- <Compile Include="System.IO.Compression\CompressionLevel.cs" />\r
- <Compile Include="System.IO.Compression\CompressionMode.cs" />\r
<Compile Include="System.IO.Compression\DeflateStream.cs" />\r
- <Compile Include="System.IO.Compression\GZipStream.cs" />\r
<Compile Include="System.IO.Ports\Handshake.cs" />\r
<Compile Include="System.IO.Ports\ISerialStream.cs" />\r
<Compile Include="System.IO.Ports\Parity.cs" />\r
</PropertyGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<ItemGroup>\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionLevel.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionMode.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\GZipStream.cs" />\r
<Compile Include="..\..\build\common\SR.cs" />\r
<Compile Include="..\referencesource\System\compmod\microsoft\win32\safehandles\SafeProcessHandle.cs" />\r
<Compile Include="..\referencesource\System\compmod\system\codedom\CodeArgumentReferenceExpression.cs" />\r
<Compile Include="..\referencesource\System\sys\system\threading\semaphore.cs" />\r
<Compile Include="..\referencesource\System\sys\system\windows\markup\ValueSerializerAttribute.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
+ <Compile Include="corefx\ZLibNative.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeCompiler.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeGenerator.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeProvider.cs" />\r
<Compile Include="Mono.Net.Security\MonoTlsStream.cs" />\r
<Compile Include="Mono.Net.Security\NoReflectionHelper.cs" />\r
<Compile Include="Mono.Net.Security\SystemCertificateValidator.cs" />\r
+ <Compile Include="Mono.Util\MonoPInvokeCallbackAttribute.cs" />\r
<Compile Include="ReferenceSources\AssertWrapper.cs" />\r
<Compile Include="ReferenceSources\AutoWebProxyScriptEngine.cs" />\r
<Compile Include="ReferenceSources\BinaryCompatibility.cs" />\r
<Compile Include="System.Diagnostics\TraceImpl.cs" />\r
<Compile Include="System.Diagnostics\TraceSourceInfo.cs" />\r
<Compile Include="System.Diagnostics\Win32EventLog.cs" />\r
- <Compile Include="System.IO.Compression\CompressionLevel.cs" />\r
- <Compile Include="System.IO.Compression\CompressionMode.cs" />\r
<Compile Include="System.IO.Compression\DeflateStream.cs" />\r
- <Compile Include="System.IO.Compression\GZipStream.cs" />\r
<Compile Include="System.IO.Ports\Handshake.cs" />\r
<Compile Include="System.IO.Ports\ISerialStream.cs" />\r
<Compile Include="System.IO.Ports\Parity.cs" />\r
</PropertyGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<ItemGroup>\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionLevel.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\CompressionMode.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.IO.Compression\src\System\IO\Compression\GZipStream.cs" />\r
<Compile Include="..\..\build\common\SR.cs" />\r
<Compile Include="..\referencesource\System\compmod\microsoft\win32\safehandles\SafeProcessHandle.cs" />\r
<Compile Include="..\referencesource\System\compmod\system\codedom\CodeArgumentReferenceExpression.cs" />\r
<Compile Include="..\referencesource\System\sys\system\threading\semaphore.cs" />\r
<Compile Include="..\referencesource\System\sys\system\windows\markup\ValueSerializerAttribute.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
+ <Compile Include="corefx\ZLibNative.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeCompiler.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeGenerator.cs" />\r
<Compile Include="Microsoft.CSharp\CSharpCodeProvider.cs" />\r
<Compile Include="Mono.Net.Security\MonoTlsStream.cs" />\r
<Compile Include="Mono.Net.Security\NoReflectionHelper.cs" />\r
<Compile Include="Mono.Net.Security\SystemCertificateValidator.cs" />\r
+ <Compile Include="Mono.Util\MonoPInvokeCallbackAttribute.cs" />\r
<Compile Include="ReferenceSources\AssertWrapper.cs" />\r
<Compile Include="ReferenceSources\AutoWebProxyScriptEngine.cs" />\r
<Compile Include="ReferenceSources\BinaryCompatibility.cs" />\r
<Compile Include="System.Diagnostics\TraceImpl.cs" />\r
<Compile Include="System.Diagnostics\TraceSourceInfo.cs" />\r
<Compile Include="System.Diagnostics\Win32EventLog.cs" />\r
- <Compile Include="System.IO.Compression\CompressionLevel.cs" />\r
- <Compile Include="System.IO.Compression\CompressionMode.cs" />\r
<Compile Include="System.IO.Compression\DeflateStream.cs" />\r
- <Compile Include="System.IO.Compression\GZipStream.cs" />\r
<Compile Include="System.IO.Ports\Handshake.cs" />\r
<Compile Include="System.IO.Ports\ISerialStream.cs" />\r
<Compile Include="System.IO.Ports\Parity.cs" />\r
#endif
{
#if XML_DEP
- XmlNode node, original;
+ XmlNode node;
+
+#if (CONFIGURATION_DEP)
+ XmlNode original;
+#endif
+
#endif
[MonoTODO]
(otherEntry.CategoryNumber == categoryNumber) &&
(otherEntry.Data.Equals (data)) &&
(otherEntry.EntryType == entryType) &&
- (otherEntry.EventID == eventID) &&
+ (otherEntry.InstanceId == instanceId) &&
(otherEntry.Index == index) &&
(otherEntry.MachineName == machineName) &&
(otherEntry.Message == message) &&
public string FileName {
get {
-#if !MOBILE
+#if FEATURE_MONO_CAS
if (SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, filename).Demand ();
}
public static FileVersionInfo GetVersionInfo (string fileName)
{
-#if !MOBILE
+#if FEATURE_MONO_CAS
if (SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.Read, fileName).Demand ();
}
SetProcessHandle (new SafeProcessHandle (procInfo.process_handle, true));
SetProcessId (procInfo.pid);
+#pragma warning disable 618
+
if (startInfo.RedirectStandardInput) {
MonoIO.Close (stdin_read, out error);
standardError = new StreamReader (new FileStream (stderr_read, FileAccess.Read, true, 8192), stderrEncoding, true);
}
+#pragma warning restore
return true;
}
_notifyResetEvent = new ManualResetEvent (false);
_lastEntryWritten = OldestEventLogEntry + EntryCount;
- if (PInvoke.NotifyChangeEventLog (ReadHandle, _notifyResetEvent.Handle) == 0)
+ if (PInvoke.NotifyChangeEventLog (ReadHandle, _notifyResetEvent.SafeWaitHandle.DangerousGetHandle ()) == 0)
throw new InvalidOperationException (string.Format (
CultureInfo.InvariantCulture, "Unable to receive notifications"
+ " for log '{0}' on computer '{1}'.", CoreEventLog.GetLogName (),
+++ /dev/null
-//
-// Authors:
-// Martin Baulig (martin.baulig@xamarin.com)
-//
-// Copyright 2012 Xamarin Inc. (http://www.xamarin.com)
-//
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-namespace System.IO.Compression {
- public enum CompressionLevel {
- Optimal,
- Fastest,
- NoCompression
- }
-}
+++ /dev/null
-/* -*- Mode: csharp; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-//
-// CompressionMOode.cs
-//
-// Authors:
-// Christopher James Lahey <clahey@ximian.com>
-//
-// (c) 2004 Novell, Inc. (http://www.novell.com)
-//
-
-namespace System.IO.Compression {
- public enum CompressionMode {
- Decompress=0, // Decompress the given stream.
- Compress=1 // Compress the given stream.
- };
-}
-
{
}
+ internal DeflateStream (Stream stream, CompressionMode mode, bool leaveOpen, int windowsBits) :
+ this (stream, mode, leaveOpen, true)
+ {
+ }
+
internal DeflateStream (Stream compressedStream, CompressionMode mode, bool leaveOpen, bool gzip)
{
if (compressedStream == null)
{
}
+ internal DeflateStream (Stream stream, CompressionLevel compressionLevel, bool leaveOpen, int windowsBits)
+ : this (stream, compressionLevel, leaveOpen, true)
+ {
+ }
+
internal DeflateStream (Stream stream, CompressionLevel compressionLevel, bool leaveOpen, bool gzip)
: this (stream, CompressionMode.Compress, leaveOpen, gzip)
{
CheckResult (res, "WriteInternal");
}
-#if MONOTOUCH || FULL_AOT_RUNTIME
[Mono.Util.MonoPInvokeCallback (typeof (UnmanagedReadOrWrite))]
-#endif
static int UnmanagedRead (IntPtr buffer, int length, IntPtr data)
{
GCHandle s = GCHandle.FromIntPtr (data);
return n;
}
-#if MONOTOUCH || FULL_AOT_RUNTIME
[Mono.Util.MonoPInvokeCallback (typeof (UnmanagedReadOrWrite))]
-#endif
static int UnmanagedWrite (IntPtr buffer, int length, IntPtr data)
{
GCHandle s = GCHandle.FromIntPtr (data);
+++ /dev/null
-/* -*- Mode: csharp; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-//
-// GZipStream.cs
-//
-// Authors:
-// Christopher James Lahey <clahey@ximian.com>
-// Gonzalo Paniagua Javier <gonzalo@novell.com>
-//
-// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com)
-//
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Runtime.Remoting.Messaging;
-
-namespace System.IO.Compression {
-
- public class GZipStream : Stream
- {
- private DeflateStream deflateStream;
-
- public GZipStream (Stream stream, CompressionMode mode) :
- this (stream, mode, false) {
- }
-
- public GZipStream (Stream stream, CompressionMode mode, bool leaveOpen) {
- this.deflateStream = new DeflateStream (stream, mode, leaveOpen, true);
- }
-
-
- public GZipStream (Stream stream, CompressionLevel compressionLevel)
- : this (stream, compressionLevel, false)
- {
- }
-
- public GZipStream (Stream stream, CompressionLevel compressionLevel, bool leaveOpen)
- {
- this.deflateStream = new DeflateStream (stream, compressionLevel, leaveOpen, true);
- }
-
- protected override void Dispose (bool disposing)
- {
- if (disposing) {
- if (deflateStream != null) {
- deflateStream.Dispose ();
- deflateStream = null;
- }
- }
- base.Dispose (disposing);
- }
-
- public override int Read (byte[] array, int offset, int count)
- {
- if (deflateStream == null)
- throw new ObjectDisposedException (GetType ().FullName);
-
- return deflateStream.Read(array, offset, count);
- }
-
-
- public override void Write (byte[] array, int offset, int count)
- {
- if (deflateStream == null)
- throw new ObjectDisposedException (GetType ().FullName);
-
- deflateStream.Write (array, offset, count);
- }
-
- public override void Flush()
- {
- if (deflateStream == null)
- throw new ObjectDisposedException (GetType ().FullName);
-
- deflateStream.Flush();
- }
-
- public override long Seek (long offset, SeekOrigin origin)
- {
- throw new NotSupportedException();
- }
-
- public override void SetLength (long value)
- {
- throw new NotSupportedException();
- }
-
- public override IAsyncResult BeginRead (byte [] buffer, int offset, int count,
- AsyncCallback cback, object state)
- {
- if (deflateStream == null)
- throw new ObjectDisposedException (GetType ().FullName);
-
- return deflateStream.BeginRead (buffer, offset, count, cback, state);
- }
-
- public override IAsyncResult BeginWrite (byte [] buffer, int offset, int count,
- AsyncCallback cback, object state)
- {
- if (deflateStream == null)
- throw new ObjectDisposedException (GetType ().FullName);
-
- return deflateStream.BeginWrite (buffer, offset, count, cback, state);
- }
-
- public override int EndRead(IAsyncResult async_result) {
- if (deflateStream == null)
- throw new ObjectDisposedException (GetType ().FullName);
-
- return deflateStream.EndRead (async_result);
- }
-
- public override void EndWrite (IAsyncResult async_result)
- {
- if (deflateStream == null)
- throw new ObjectDisposedException (GetType ().FullName);
-
- deflateStream.EndWrite (async_result);
- }
-
- public Stream BaseStream {
- get {
- if (deflateStream == null)
- return null;
-
- return deflateStream.BaseStream;
- }
- }
-
- public override bool CanRead {
- get {
- if (deflateStream == null)
- return false;
-
- return deflateStream.CanRead;
- }
- }
-
- public override bool CanSeek {
- get {
- if (deflateStream == null)
- return false;
-
- return deflateStream.CanSeek;
- }
- }
-
- public override bool CanWrite {
- get {
- if (deflateStream == null)
- return false;
-
- return deflateStream.CanWrite;
- }
- }
-
- public override long Length {
- get { throw new NotSupportedException(); }
- }
-
- public override long Position {
- get { throw new NotSupportedException(); }
- set { throw new NotSupportedException(); }
- }
- }
-}
-
-
}
}
-#if MONOTOUCH || FULL_AOT_RUNTIME
[Mono.Util.MonoPInvokeCallback (typeof (SCNetworkReachabilityCallback))]
-#endif
static void HandleCallback (IntPtr reachability, NetworkReachabilityFlags flags, IntPtr info)
{
if (info == IntPtr.Zero)
#endif
};
static readonly string PingBinPath;
+ static bool canSendPrivileged;
#endif
const int default_timeout = 4000; // 4 sec.
ushort identifier;
const UInt32 linux_cap_version = 0x20071026;
static readonly byte [] default_buffer = new byte [0];
- static bool canSendPrivileged;
BackgroundWorker worker;
const string EXCEPTION_MESSAGE = "System.Net.Security.SslStream is not supported on the current platform.";
public SslStream (Stream innerStream)
- : this (innerStream, false, null, null)
+ : this (innerStream, false)
{
}
public SslStream (Stream innerStream, bool leaveInnerStreamOpen)
- : this (innerStream, leaveInnerStreamOpen, null, null)
+ : base (innerStream, leaveInnerStreamOpen)
{
+ throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback)
- : this (innerStream, leaveInnerStreamOpen, userCertificateValidationCallback, null)
+ : this (innerStream, leaveInnerStreamOpen)
{
}
+#if SECURITY_DEP
public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback)
- : base (innerStream, leaveInnerStreamOpen)
+ : this (innerStream, leaveInnerStreamOpen)
{
- throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SslStream (Stream innerStream, bool leaveInnerStreamOpen, RemoteCertificateValidationCallback userCertificateValidationCallback, LocalCertificateSelectionCallback userCertificateSelectionCallback, EncryptionPolicy encryptionPolicy)
- : this (innerStream, leaveInnerStreamOpen, userCertificateValidationCallback, userCertificateSelectionCallback)
+ : this (innerStream, leaveInnerStreamOpen)
{
}
+#endif
public virtual void AuthenticateAsClient (string targetHost)
{
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
+#if SECURITY_DEP
public AuthenticationSchemeSelector AuthenticationSchemeSelectorDelegate {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
set { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
+#endif
public bool IgnoreWriteExceptions {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
public IPrincipal User {
get { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); }
}
-
+#if SECURITY_DEP
public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol)
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
{
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
+#endif
}
}
if (pubkey == null)
return false;
// Sadly X509Certificate2 doesn't expose the signature nor the tbs (to be signed) structure
- MX.X509Certificate mx = signed.MonoCertificate;
+ var mx = signed.MonoCertificate;
return (mx.VerifySignature (pubkey));
}
{
if (ext == null)
return String.Empty;
- MX.Extensions.AuthorityKeyIdentifierExtension aki = new MX.Extensions.AuthorityKeyIdentifierExtension (ext);
+ var aki = new MX.Extensions.AuthorityKeyIdentifierExtension (ext);
byte[] id = aki.Identifier;
if (id == null)
return String.Empty;
internal static class Platform {
static bool checkedOS;
static bool isMacOS;
- static bool isFreeBSD;
#if MONOTOUCH || XAMMAC
+ const bool isFreeBSD = false;
+
private static void CheckOS() {
isMacOS = true;
checkedOS = true;
}
#else
+ static bool isFreeBSD;
+
[DllImport ("libc")]
static extern int uname (IntPtr buf);
Assembly/AssemblyInfo.cs
../../build/common/SR.cs
+corefx/ZLibNative.cs
+
Microsoft.Win32.SafeHandles/SafeX509ChainHandle.cs
System/IOSelector.cs
System.Diagnostics/ThreadWaitReason.cs
System.Diagnostics/TraceImpl.cs
-System.IO.Compression/CompressionLevel.cs
-System.IO.Compression/CompressionMode.cs
System.IO.Compression/DeflateStream.cs
-System.IO.Compression/GZipStream.cs
System.IO/ErrorEventArgs.cs
System.IO/ErrorEventHandler.cs
Mono.Net.Security/NoReflectionHelper.cs
Mono.Net.Security/SystemCertificateValidator.cs
+Mono.Util/MonoPInvokeCallbackAttribute.cs
+
ReferenceSources/AutoWebProxyScriptEngine.cs
ReferenceSources/AssertWrapper.cs
ReferenceSources/CAPI.cs
../referencesource/System/compmod/system/codedom/compiler/IndentTextWriter.cs
../referencesource/System/compmod/microsoft/win32/safehandles/SafeProcessHandle.cs
+
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/CompressionLevel.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/CompressionMode.cs
+../../../external/corefx/src/System.IO.Compression/src/System/IO/Compression/GZipStream.cs
--- /dev/null
+namespace System.IO.Compression
+{
+ class ZLibNative
+ {
+ public const int GZip_DefaultWindowBits = 31;
+ }
+}
\ No newline at end of file
#include common.sources
-
System.IO/FileSystemWatcher_mobile.cs
-
-../Mono.Security/Mono.Security.Authenticode/PrivateKey.cs
-../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
-../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/MessageBase.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmFlags.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmSettings.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type1Message.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type2Message.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type3Message.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Alert.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Context.cs
-../Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/GeneralNames.cs
-../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
-
-../Mono.Security/Mono.Security.Interface/Alert.cs
-../Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs
-../Mono.Security/Mono.Security.Interface/CipherAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs
-../Mono.Security/Mono.Security.Interface/ExchangeAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/HashAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/IBufferOffsetSize.cs
-../Mono.Security/Mono.Security.Interface/IMonoTlsEventSink.cs
-../Mono.Security/Mono.Security.Interface/IMonoSslStream.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs
-../Mono.Security/Mono.Security.Interface/TlsException.cs
-../Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs
-../Mono.Security/Mono.Security.Interface/TlsProtocols.cs
-
System.Net/MacProxy.cs
-Mono.Util/MonoPInvokeCallbackAttribute.cs
Mono.Net.Security/MonoTlsProviderFactory.Apple.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.Apple.cs
-../Mono.Security/Mono.Security.Authenticode/PrivateKey.cs
-../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
-../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
-../Mono.Security/Mono.Security.Interface/Alert.cs
-../Mono.Security/Mono.Security.Interface/CertificateValidationHelper.cs
-../Mono.Security/Mono.Security.Interface/CipherAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/CipherSuiteCode.cs
-../Mono.Security/Mono.Security.Interface/ExchangeAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/HashAlgorithmType.cs
-../Mono.Security/Mono.Security.Interface/IBufferOffsetSize.cs
-../Mono.Security/Mono.Security.Interface/IMonoSslStream.cs
-../Mono.Security/Mono.Security.Interface/IMonoTlsContext.cs
-../Mono.Security/Mono.Security.Interface/IMonoTlsEventSink.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsConnectionInfo.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProvider.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.Apple.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsSettings.cs
-../Mono.Security/Mono.Security.Interface/TlsException.cs
-../Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs
-../Mono.Security/Mono.Security.Interface/TlsProtocols.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/MessageBase.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmFlags.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmSettings.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type1Message.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type2Message.cs
-../Mono.Security/Mono.Security.Protocol.Ntlm/Type3Message.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Alert.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Context.cs
-../Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs
Mono.Http/NtlmClient.cs
Mono.Net.Security/AsyncProtocolRequest.cs
Mono.Net.Security/CallbackHelpers.cs
System.Net/HttpWebResponse.platformnotsupported.cs
System.Net/ServicePoint.platformnotsupported.cs
System.Net/ServicePointManager.platformnotsupported.cs
+../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
#include mobile_System.dll.sources
-Mono.Util/MonoPInvokeCallbackAttribute.cs
#include common.sources
-Mono.Util/MonoPInvokeCallbackAttribute.cs
#include mobile_System.dll.sources
Mono.Net.Security/MonoTlsProviderFactory.Apple.cs
-../Mono.Security/Mono.Security.Interface/MonoTlsProviderFactory.Apple.cs
# AOT build profile to speed up build
ifeq ($(PROFILE),build)
-IMAGES = $(mscorlib_aot_image)
+# $(mscorlib_aot_image) is disabled due to runtime bug #50434
+IMAGES =
ifdef MCS_MODE
IMAGES += $(mcs_aot_image)
public virtual string GetFileName()
{
-#if !MOBILE
+#if FEATURE_MONO_CAS
if (SecurityManager.SecurityEnabled && (fileName != null) && (fileName.Length > 0)) {
string fn = Path.GetFullPath (fileName);
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, fn).Demand ();
/// </summary>
public static string GetEnvironmentVariable (string variable)
{
-#if !MOBILE
+#if FEATURE_MONO_CAS
if (SecurityManager.SecurityEnabled) {
new EnvironmentPermission (EnvironmentPermissionAccess.Read, variable).Demand ();
}
else
dir = UnixGetFolderPath (folder, option);
-#if !MOBILE
+#if FEATURE_MONO_CAS
if ((dir != null) && (dir.Length > 0) && SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, dir).Demand ();
}
private static IPHostEntry GetLocalHost()
{
#if MONO
+#pragma warning disable 618
return Dns.GetHostByName (Dns.GetHostName ());
+#pragma warning restore
#else
//
// IPv6 Changes: If IPv6 is enabled, we can't simply use the
var data = AndroidPlatform.GetDefaultProxy ();
if (data != null)
return data;
+
+ return new WebProxy (true);
#else
if (Platform.IsMacOS) {
var data = Mono.Net.CFNetwork.GetDefaultProxy ();
if (data != null)
return data;
}
-#endif
return new WebProxy (true);
+#endif
}
#endif
</PostBuildEvent>\r
</PropertyGroup>\r
<ItemGroup>\r
+ <ProjectReference Include="../class/corlib/corlib-net_4_x.csproj">\r
+ <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
+ <Name>corlib-net_4_x</Name>\r
+ </ProjectReference>\r
<ProjectReference Include="../class/PEAPI/PEAPI-net_4_x.csproj">\r
<Project>{34443C71-09F1-4F21-ABB4-82822376F74F}</Project>\r
<Name>PEAPI-net_4_x</Name>\r
<Project>{42D59DE7-586F-4ACF-BDD5-E7869E39E3EF}</Project>\r
<Name>Mono.Security-net_4_x</Name>\r
</ProjectReference>\r
- <ProjectReference Include="../class/corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
</ItemGroup>\r
<ItemGroup>\r
<Folder Include="Properties\" />\r
$$ = new ArrayCreation ((FullNamedExpression) $2, (List<Expression>) $4,
new ComposedTypeSpecifier (((List<Expression>) $4).Count, GetLocation ($3)) {
Next = (ComposedTypeSpecifier) $6
- }, (ArrayInitializer) $7, GetLocation ($1));
+ }, (ArrayInitializer) $7, GetLocation ($1)) {
+ NoEmptyInterpolation = true
+ };
+
lbag.AddLocation ($$, GetLocation ($3), GetLocation ($5));
}
| NEW new_expr_type rank_specifiers opt_array_initializer
return ParseResult.Success;
case "/debug":
- if (value.Equals ("full", StringComparison.OrdinalIgnoreCase) || value.Equals ("pdbonly", StringComparison.OrdinalIgnoreCase) || idx < 0) {
+ if (value.Equals ("full", StringComparison.OrdinalIgnoreCase) || value.Equals ("pdbonly", StringComparison.OrdinalIgnoreCase) || value.Equals ("portable", StringComparison.OrdinalIgnoreCase) || idx < 0) {
settings.GenerateDebugInfo = true;
return ParseResult.Success;
}
if (ReferenceEquals (a, b))
return 2;
+ a = new byte[0];
b = new byte[0];
if (a.Equals (b))
return 3;
</type>
<type name="Tester+<GetIndex_3>c__AnonStorey1">
<method name="Void <>m__0(System.Dynamic.GetIndexBinder, System.Object[])" attrs="131">
- <size>92</size>
+ <size>93</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="Tester+<InvokeMember_2>c__AnonStorey2">
<method name="Void <>m__0(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="131">
- <size>109</size>
+ <size>110</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="Tester+<InvokeMember_6>c__AnonStorey3">
<method name="Void <>m__0(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="131">
- <size>119</size>
+ <size>120</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="Tester+<SetIndex_3>c__AnonStorey4">
<method name="Void <>m__0(System.Dynamic.SetIndexBinder, System.Object[], System.Object)" attrs="131">
- <size>119</size>
+ <size>120</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<size>67</size>
</method>
<method name="Void <GetIndex_1>m__25(System.Dynamic.GetIndexBinder, System.Object[])" attrs="145">
- <size>92</size>
+ <size>93</size>
</method>
<method name="Void <GetIndex_2>m__26(System.Dynamic.GetIndexBinder, System.Object[])" attrs="145">
- <size>111</size>
+ <size>112</size>
</method>
<method name="System.Object <GetMember_1>m__27(System.Dynamic.GetMemberBinder)" attrs="145">
<size>75</size>
</method>
<method name="Void <Invoke_1>m__28(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">
- <size>101</size>
+ <size>102</size>
</method>
<method name="Void <Invoke_2>m__29(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">
- <size>72</size>
+ <size>74</size>
</method>
<method name="Void <Invoke_4>m__2A(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">
<size>128</size>
</method>
<method name="Void <Invoke_5>m__2B(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">
- <size>91</size>
+ <size>92</size>
</method>
<method name="Void <Invoke_5>m__2C(System.Object)" attrs="145">
<size>94</size>
</method>
<method name="Void <Invoke_6>m__2D(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">
- <size>92</size>
+ <size>93</size>
</method>
<method name="Void <InvokeMember_1>m__2E(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">
- <size>110</size>
+ <size>111</size>
</method>
<method name="Void <InvokeMember_3>m__2F(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">
- <size>111</size>
+ <size>112</size>
</method>
<method name="Void <InvokeMember_4>m__30(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">
- <size>110</size>
+ <size>111</size>
</method>
<method name="Void <InvokeMember_7>m__31(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">
- <size>89</size>
+ <size>91</size>
</method>
<method name="Void <InvokeMember_8>m__32(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">
- <size>111</size>
+ <size>112</size>
</method>
<method name="Void <SetIndex_1>m__33(System.Dynamic.SetIndexBinder, System.Object[], System.Object)" attrs="145">
- <size>124</size>
+ <size>125</size>
</method>
<method name="Void <SetIndex_2>m__34(System.Dynamic.SetIndexBinder, System.Object[], System.Object)" attrs="145">
- <size>139</size>
+ <size>140</size>
</method>
<method name="Void <SetMember_1>m__35(System.Dynamic.SetMemberBinder, System.Object)" attrs="145">
<size>102</size>
<test name="dtest-044.cs">
<type name="C">
<method name="Int32 Main()" attrs="150">
- <size>867</size>
+ <size>868</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<size>23</size>
</method>
<method name="Int32 Main()" attrs="150">
- <size>212</size>
+ <size>213</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<size>84</size>
</method>
<method name="Void .ctor()" attrs="6278">
- <size>19</size>
+ <size>20</size>
</method>
<method name="Void .ctor(E[])" attrs="6278">
<size>15</size>
</type>
<type name="Crash">
<method name="Void Main()" attrs="150">
- <size>14</size>
+ <size>15</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="Tests">
<method name="Void Main()" attrs="150">
- <size>21</size>
+ <size>22</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="Tests">
<method name="Void Main()" attrs="150">
- <size>38</size>
+ <size>39</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<test name="gtest-340.cs">
<type name="Tests">
<method name="T[] FindAll[T](T[], System.Predicate`1[T])" attrs="150">
- <size>14</size>
+ <size>15</size>
</method>
<method name="Boolean ProtectedOnly(System.Reflection.MemberInfo)" attrs="129">
<size>10</size>
</type>
<type name="Base">
<method name="System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()" attrs="481">
- <size>19</size>
+ <size>20</size>
</method>
</type>
</test>
<size>10</size>
</method>
<method name="Int32 Main()" attrs="150">
- <size>50</size>
+ <size>51</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<test name="gtest-495.cs">
<type name="Repro">
<method name="Void Main()" attrs="150">
- <size>12</size>
+ <size>13</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<size>2</size>
</method>
<method name="Void Test()" attrs="134">
- <size>37</size>
+ <size>38</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="C">
<method name="Int32 Main()" attrs="150">
- <size>78</size>
+ <size>80</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<size>2</size>
</method>
<method name="Void Main()" attrs="150">
- <size>48</size>
+ <size>51</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="X2">
<method name="Void Main()" attrs="150">
- <size>22</size>
+ <size>24</size>
</method>
<method name="Void Foo[T1,T2](T2[])" attrs="145">
<size>9</size>
<size>123</size>
</method>
<method name="Void ArrayIndexTest_7()" attrs="129">
- <size>126</size>
+ <size>127</size>
</method>
<method name="Void ArrayLengthTest()" attrs="129">
- <size>99</size>
+ <size>100</size>
</method>
<method name="Void ArrayLengthTest_2()" attrs="129">
<size>92</size>
<size>92</size>
</method>
<method name="Void NewArrayInitTest_2()" attrs="129">
- <size>62</size>
+ <size>63</size>
</method>
<method name="Void NewArrayInitTest_3()" attrs="129">
<size>137</size>
<size>74</size>
</method>
<method name="Void ParameterTest_2()" attrs="129">
- <size>74</size>
+ <size>76</size>
</method>
<method name="Void ParameterTest_3()" attrs="129">
<size>74</size>
<test name="gtest-exmethod-20.cs">
<type name="Outer.Inner.Test">
<method name="Void M(I)" attrs="145">
- <size>13</size>
+ <size>14</size>
</method>
<method name="Void Main()" attrs="150">
<size>2</size>
<test name="gtest-exmethod-27.cs">
<type name="Bar.Program">
<method name="Void Main()" attrs="150">
- <size>17</size>
+ <size>18</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="A">
<method name="Void Main()" attrs="150">
- <size>12</size>
+ <size>13</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<size>23</size>
</method>
<method name="Int32 Main()" attrs="150">
- <size>87</size>
+ <size>88</size>
</method>
<method name="Boolean Foo(Int32[])" attrs="145">
<size>52</size>
<test name="gtest-friend-14.cs">
<type name="Test">
<method name="Int32 Main()" attrs="150">
- <size>20</size>
+ <size>21</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="C`1[T]">
<method name="System.Collections.IEnumerator GetEnumerator()" attrs="134">
- <size>19</size>
+ <size>20</size>
</method>
</type>
<type name="C`1+<Filter>c__Iterator0[T]">
<size>10</size>
</method>
<method name="Int32 Main()" attrs="150">
- <size>52</size>
+ <size>53</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<test name="gtest-linq-01.cs">
<type name="from.C">
<method name="Void Main()" attrs="150">
- <size>2179</size>
+ <size>2181</size>
</method>
<method name="Void Foo(Int32, Boolean)" attrs="129">
<size>16</size>
</type>
<type name="NameCollisionTest.C">
<method name="Void Main()" attrs="150">
- <size>78</size>
+ <size>79</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="C">
<method name="Void <Main>m__0()" attrs="145">
- <size>159</size>
+ <size>162</size>
</method>
<method name="System.Collections.Generic.IEnumerable`1[B] <Main>m__1(A)" attrs="145">
- <size>14</size>
+ <size>15</size>
</method>
<method name="<>__AnonType0`2[A,B] <Main>m__2(A, B)" attrs="145">
<size>16</size>
<test name="gtest-variance-13.cs">
<type name="A">
<method name="Void Test()" attrs="150">
- <size>17</size>
+ <size>18</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<test name="gtest-variance-19.cs">
<type name="Test">
<method name="Void Bla[T,U]()" attrs="145">
- <size>12</size>
+ <size>13</size>
</method>
<method name="Void Main()" attrs="150">
<size>7</size>
<test name="test-232.cs">
<type name="CtorInfoTest">
<method name="Void Main(System.String[])" attrs="150">
- <size>977</size>
+ <size>978</size>
</method>
<method name="Void Assert(System.Object, System.Object)" attrs="145">
<size>43</size>
</type>
<type name="SimpleAttribute">
<method name="Int64[] get_ArrayValue()" attrs="2182">
- <size>14</size>
+ <size>15</size>
</method>
<method name="Void set_ArrayValue(Int64[])" attrs="2182">
<size>2</size>
</type>
<type name="X+Derived+Nested">
<method name="Void G()" attrs="134">
- <size>21</size>
+ <size>22</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<size>7</size>
</method>
<method name="System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()" attrs="481">
- <size>19</size>
+ <size>20</size>
</method>
</type>
</test>
<size>12</size>
</method>
<method name="Void TestCallOnly()" attrs="129">
- <size>65</size>
+ <size>66</size>
</method>
<method name="Void SomeMethod()" attrs="486">
<size>2</size>
<size>2</size>
</method>
<method name="Int32 Main()" attrs="150">
- <size>284</size>
+ <size>288</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
<test name="test-934.cs">
<type name="X">
<method name="Int32 Main()" attrs="150">
- <size>106</size>
+ <size>114</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="AwaitNS.MemberAccess">
<method name="Void M()" attrs="145">
- <size>12</size>
+ <size>13</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</type>
<type name="O">
<method name="Void Main()" attrs="150">
- <size>22</size>
+ <size>23</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
str.WriteLine ("partial class SR");
str.WriteLine ("{");
foreach (var entry in txtStrings) {
- str.Write ($"\tpublic const string {entry.Item1} = \"{entry.Item2}\";");
+ str.Write ($"\tpublic const string {entry.Item1} = \"{ToCSharpString (entry.Item2)}\";");
if (!string.IsNullOrEmpty (entry.Item3))
str.Write (" // {entry.Item3}");
}
}
+ static string ToCSharpString (string str)
+ {
+ str = str.Replace ("\n", "\\n");
+
+ return str.Replace ("\\", "\\\\").Replace ("\"", "\\\"");
+ }
+
static bool LoadStrings (List<Tuple<string, string, string>> resourcesStrings, List<string> files)
{
var keys = new Dictionary<string, string> ();
build-shared/Makefile:
-mkdir -p build-shared
- (cd build-shared && $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) -DBUILD_SHARED_LIBS=1 $(abs_top_srcdir)/mono/btls)
+ (cd build-shared && CC="$(CC)" CXX="$(CXX)" $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) -DBUILD_SHARED_LIBS=1 $(abs_top_srcdir)/mono/btls)
build-shared/libmono-btls-shared$(libsuffix): build-shared/Makefile
$(MAKE) -C build-shared $(CMAKE_VERBOSE)
build-static/Makefile:
-mkdir -p build-static
- (cd build-static && $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) $(abs_top_srcdir)/mono/btls)
+ (cd build-static && CC="$(CC)" CXX="$(CXX)" $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) $(abs_top_srcdir)/mono/btls)
build-static/libmono-btls-static.a: build-static/Makefile
$(MAKE) -C build-static $(CMAKE_VERBOSE)
RUNTIME_EXECUTABLE = $(if $(BOEHM),$(top_builddir)/mono/mini/mono-boehm,$(top_builddir)/runtime/mono-wrapper)
MINI_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME_EXECUTABLE)
+TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/mono-wrapper
RUNTIME_AOTCHECK = MONO_PATH="$(CLASS)$(PLATFORM_PATH_SEPARATOR)." $(RUNTIME_EXECUTABLE)
-MCS = CSC_SDK_PATH_DISABLED= $(MINI_RUNTIME) $(CSC) -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll
-ILASM = $(MINI_RUNTIME) $(CLASS)/ilasm.exe
+MCS = CSC_SDK_PATH_DISABLED= $(TOOLS_RUNTIME) $(CSC) -unsafe -nowarn:0162 -nologo -noconfig -r:$(CLASS)/mscorlib.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Core.dll
+ILASM = $(TOOLS_RUNTIME) $(mcs_topdir)/class/lib/build/ilasm.exe
AM_CFLAGS = \
-I$(top_srcdir) \
System.Security.dll \
Mono.Simd.dll \
Mono.Security.dll \
+ System.Numerics.dll \
System.Numerics.Vectors.dll
if INSTALL_TESTING_AOT_FULL
/* begin-invoke */
method = mono_get_delegate_begin_invoke (klass);
- create_gsharedvt_inst (acfg, method, &ctx);
+ if (method) {
+ create_gsharedvt_inst (acfg, method, &ctx);
- inst = mono_class_inflate_generic_method_checked (method, &ctx, &error);
- g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
+ inst = mono_class_inflate_generic_method_checked (method, &ctx, &error);
+ g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
- m = mono_marshal_get_delegate_begin_invoke (inst);
- g_assert (m->is_inflated);
+ m = mono_marshal_get_delegate_begin_invoke (inst);
+ g_assert (m->is_inflated);
- gshared = mini_get_shared_method_full (m, FALSE, TRUE);
- add_extra_method (acfg, gshared);
+ gshared = mini_get_shared_method_full (m, FALSE, TRUE);
+ add_extra_method (acfg, gshared);
+ }
/* end-invoke */
method = mono_get_delegate_end_invoke (klass);
- create_gsharedvt_inst (acfg, method, &ctx);
-
- inst = mono_class_inflate_generic_method_checked (method, &ctx, &error);
- g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
+ if (method) {
+ create_gsharedvt_inst (acfg, method, &ctx);
- m = mono_marshal_get_delegate_end_invoke (inst);
- g_assert (m->is_inflated);
+ inst = mono_class_inflate_generic_method_checked (method, &ctx, &error);
+ g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
- gshared = mini_get_shared_method_full (m, FALSE, TRUE);
- add_extra_method (acfg, gshared);
+ m = mono_marshal_get_delegate_end_invoke (inst);
+ g_assert (m->is_inflated);
+ gshared = mini_get_shared_method_full (m, FALSE, TRUE);
+ add_extra_method (acfg, gshared);
+ }
}
}
GSList *bps;
/* The number of frames at the start of a step-over */
int nframes;
+ /* If set, don't stop in methods that are not part of user assemblies */
+ MonoAssembly** user_assemblies;
} SingleStepReq;
/*
if (method->klass == mono_defaults.string_class && (!strcmp (method->name, "memset") || strstr (method->name, "memcpy")))
return;
+ /*
+ * This could be in ss_update method, but mono_find_next_seq_point_for_native_offset is pretty expensive method,
+ * hence we prefer this check here.
+ */
+ if (ss_req->user_assemblies) {
+ gboolean found = FALSE;
+ for (int k = 0; ss_req->user_assemblies[k]; k++)
+ if (ss_req->user_assemblies[k] == method->klass->image->assembly) {
+ found = TRUE;
+ break;
+ }
+ if (!found)
+ return;
+ }
+
+
/*
* The ip points to the instruction causing the single step event, which is before
* the offset recorded in the seq point map, so find the next seq point after ip.
nframes = tls->frame_count;
}
+ /* Need to stop in catch clauses as well */
+ for (i = ss_req->depth == STEP_DEPTH_OUT ? 1 : 0; i < nframes; ++i) {
+ StackFrame *frame = frames [i];
+
+ if (frame->ji) {
+ MonoJitInfo *jinfo = frame->ji;
+ for (j = 0; j < jinfo->num_clauses; ++j) {
+ MonoJitExceptionInfo *ei = &jinfo->clauses [j];
+
+ if (mono_find_next_seq_point_for_native_offset (frame->domain, frame->method, (char*)ei->handler_start - (char*)jinfo->code_start, NULL, &local_sp))
+ ss_bp_add_one (ss_req, &ss_req_bp_count, &ss_req_bp_cache, frame->method, local_sp.il_offset);
+ }
+ }
+ }
+
/*
* Find the first sequence point in the current or in a previous frame which
* is not the last in its method.
ss_req->depth = STEP_DEPTH_INTO;
}
- if (ss_req->depth == STEP_DEPTH_OVER) {
- /* Need to stop in catch clauses as well */
- for (i = 0; i < nframes; ++i) {
- StackFrame *frame = frames [i];
-
- if (frame->ji) {
- MonoJitInfo *jinfo = frame->ji;
- for (j = 0; j < jinfo->num_clauses; ++j) {
- MonoJitExceptionInfo *ei = &jinfo->clauses [j];
-
- found_sp = mono_find_next_seq_point_for_native_offset (frame->domain, frame->method, (char*)ei->handler_start - (char*)jinfo->code_start, NULL, &local_sp);
- sp = (found_sp)? &local_sp : NULL;
-
- if (found_sp)
- ss_bp_add_one (ss_req, &ss_req_bp_count, &ss_req_bp_cache, frame->method, sp->il_offset);
- }
- }
- }
- }
-
if (ss_req->depth == STEP_DEPTH_INTO) {
/* Enable global stepping so we stop at method entry too */
enable_global = TRUE;
ss_req->filter = filter;
req->info = ss_req;
+ for (int i = 0; i < req->nmodifiers; i++) {
+ if (req->modifiers[i].kind == MOD_KIND_ASSEMBLY_ONLY) {
+ ss_req->user_assemblies = req->modifiers[i].data.assemblies;
+ break;
+ }
+ }
+
mono_loader_lock ();
tls = (DebuggerTlsData *)mono_g_hash_table_lookup (thread_to_tls, thread);
mono_loader_unlock ();
}
if (match_count) {
- newassemblies = g_new0 (MonoAssembly*, count - match_count);
+ // +1 because we don't know length and we use last element to check for end
+ newassemblies = g_new0 (MonoAssembly*, count - match_count + 1);
pos = 0;
for (i = 0; i < count; ++i)
int n = decode_int (p, &p, end);
int j;
- req->modifiers [i].data.assemblies = g_new0 (MonoAssembly*, n);
+ // +1 because we don't know length and we use last element to check for end
+ req->modifiers [i].data.assemblies = g_new0 (MonoAssembly*, n + 1);
for (j = 0; j < n; ++j) {
req->modifiers [i].data.assemblies [j] = decode_assemblyid (p, &p, end, &domain, &err);
if (err != ERR_NONE) {
targetinfo = (PMonoUnwindInfo)ALIGN_TO (pos, 8);
+ targetinfo->runtimeFunction.BeginAddress = ((DWORD64)ji->code_start) - ((DWORD64)Context);
+ targetinfo->runtimeFunction.EndAddress = pos - ((DWORD64)Context);
targetinfo->runtimeFunction.UnwindData = ((DWORD64)&targetinfo->unwindInfo) - ((DWORD64)Context);
return &targetinfo->runtimeFunction;
g_free (unwindinfo);
*monoui = 0;
+}
+
+void
+mono_arch_code_chunk_new (void *chunk, int size)
+{
+ BOOLEAN success = RtlInstallFunctionTableCallback (((DWORD64)chunk) | 0x3, (DWORD64)chunk, size, MONO_GET_RUNTIME_FUNCTION_CALLBACK, chunk, NULL);
+ g_assert (success);
+}
- RtlInstallFunctionTableCallback (((DWORD64)code) | 0x3, (DWORD64)code, code_size, MONO_GET_RUNTIME_FUNCTION_CALLBACK, code, NULL);
+void mono_arch_code_chunk_destroy (void *chunk)
+{
+ BOOLEAN success = RtlDeleteFunctionTable ((PRUNTIME_FUNCTION)((DWORD64)chunk | 0x03));
+ g_assert (success);
}
#endif /* defined(TARGET_WIN32) !defined(DISABLE_JIT) */
gboolean variant_iface = FALSE;
guint32 slot;
int offset;
+ gboolean special_array_interface = cmethod->klass->is_array_special_interface;
/*
* In llvm-only mode, vtables contain function descriptors instead of
return emit_extra_arg_calli (cfg, fsig, sp, arg_reg, call_target);
}
- if (!fsig->generic_param_count && is_iface && !variant_iface && !is_gsharedvt) {
+ if (!fsig->generic_param_count && is_iface && !variant_iface && !is_gsharedvt && !special_array_interface) {
/*
* A simple interface call
*
return emit_llvmonly_calli (cfg, fsig, sp, ftndesc_ins);
}
- if ((fsig->generic_param_count || variant_iface) && !is_gsharedvt) {
+ if ((fsig->generic_param_count || variant_iface || special_array_interface) && !is_gsharedvt) {
/*
* This is similar to the interface case, the vtable slot points to an imt thunk which is
* dynamically extended as more instantiations are discovered.
* request a generic sharing context.
*/
if (context_used &&
- ((method->flags & METHOD_ATTRIBUTE_STATIC) || method->klass->valuetype))
+ ((cfg->method->flags & METHOD_ATTRIBUTE_STATIC) || cfg->method->klass->valuetype))
mono_get_vtable_var (cfg);
}
void mono_arch_unwindinfo_install_unwind_info (gpointer* monoui, gpointer code, guint code_size);
#define MONO_ARCH_HAVE_UNWIND_TABLE 1
+
+void mono_arch_code_chunk_new (void *chunk, int size);
+void mono_arch_code_chunk_destroy (void *chunk);
+#define MONO_ARCH_HAVE_CODE_CHUNK_TRACKING 1
#endif
CallInfo* mono_arch_get_call_info (MonoMemPool *mp, MonoMethodSignature *sig);
domain->runtime_info = NULL;
}
+#ifdef MONO_ARCH_HAVE_CODE_CHUNK_TRACKING
+
+static void
+code_manager_chunk_new (void *chunk, int size)
+{
+ mono_arch_code_chunk_new (chunk, size);
+}
+
+static void
+code_manager_chunk_destroy (void *chunk)
+{
+ mono_arch_code_chunk_destroy (chunk);
+}
+
+#endif
+
#ifdef ENABLE_LLVM
static gboolean
llvm_init_inner (void)
MonoDomain *domain;
MonoRuntimeCallbacks callbacks;
MonoThreadInfoRuntimeCallbacks ticallbacks;
+ MonoCodeManagerCallbacks code_manager_callbacks;
MONO_VES_INIT_BEGIN ();
mono_code_manager_init ();
+ memset (&code_manager_callbacks, 0, sizeof (code_manager_callbacks));
+#ifdef MONO_ARCH_HAVE_CODE_CHUNK_TRACKING
+ code_manager_callbacks.chunk_new = code_manager_chunk_new;
+ code_manager_callbacks.chunk_destroy = code_manager_chunk_destroy;
+#endif
+ mono_code_manager_install_callbacks (&code_manager_callbacks);
+
mono_hwcap_init ();
mono_arch_cpu_init ();
assemblyresolve_event3.exe \
delegate2.exe \
finally_guard.exe \
- gc-altstack.exe \
generic-xdomain.2.exe
# failing tests which we temporarily disable for PRs
static size_t dynamic_code_alloc_count;
static size_t dynamic_code_bytes_count;
static size_t dynamic_code_frees_count;
+static MonoCodeManagerCallbacks code_manager_callbacks;
/*
* AMD64 processors maintain icache coherency only for pages which are
codechunk_cleanup ();
}
+void
+mono_code_manager_install_callbacks (MonoCodeManagerCallbacks* callbacks)
+{
+ code_manager_callbacks = *callbacks;
+}
+
/**
* mono_code_manager_new:
*
for (; chunk; ) {
dead = chunk;
mono_profiler_code_chunk_destroy ((gpointer) dead->data);
+ if (code_manager_callbacks.chunk_destroy)
+ code_manager_callbacks.chunk_destroy ((gpointer)dead->data);
chunk = chunk->next;
if (dead->flags == CODE_FLAG_MMAP) {
codechunk_vfree (dead->data, dead->size);
chunk->flags = flags;
chunk->pos = bsize;
chunk->bsize = bsize;
+ if (code_manager_callbacks.chunk_new)
+ code_manager_callbacks.chunk_new ((gpointer)chunk->data, chunk->size);
mono_profiler_code_chunk_new((gpointer) chunk->data, chunk->size);
code_memory_used += chunk_size;
typedef struct _MonoCodeManager MonoCodeManager;
+typedef struct {
+ void (*chunk_new) (void *chunk, int size);
+ void (*chunk_destroy) (void *chunk);
+} MonoCodeManagerCallbacks;
+
MONO_API MonoCodeManager* mono_code_manager_new (void);
MONO_API MonoCodeManager* mono_code_manager_new_dynamic (void);
MONO_API void mono_code_manager_destroy (MonoCodeManager *cman);
MONO_API int mono_code_manager_size (MonoCodeManager *cman, int *used_size);
MONO_API void mono_code_manager_init (void);
MONO_API void mono_code_manager_cleanup (void);
+MONO_API void mono_code_manager_install_callbacks (MonoCodeManagerCallbacks* callbacks);
/* find the extra block allocated to resolve branches close to code */
typedef int (*MonoCodeManagerFunc) (void *data, int csize, int size, void *user_data);
<fx_version>4.0</fx_version>
<profile>basic</profile>
<resources></resources>
- <response>System.dll.sources</response>
+ <response>./../../build/deps/basic_System.dll.sources</response>
</project>
<project dir="class/System.XML" library="System.Xml-basic">
<boot>true</boot>
</project>
<project dir="class/System.Core" library="System.Core-basic">
<boot>true</boot>
- <flags>/codepage:65001 /nologo /noconfig -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib -r:./../../class/lib/basic/mscorlib.dll -optimize -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -nowarn:436 -d:NET_3_5 -nowarn:1720 -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT -r:./../../class/lib/basic/System.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib -r:./../../class/lib/basic/mscorlib.dll -optimize -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -nowarn:436 -d:NET_3_5 -d:FEATURE_COMPILE,FEATURE_COMPILE_TO_METHODBUILDER,FEATURE_PDB_GENERATOR -r:./../../class/lib/basic/System.dll</flags>
<output>System.Core.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/basic/System.Core.dll</library_output>
</project>
<project dir="class/Facades/System.ValueTuple" library="Facades_System.ValueTuple-basic">
<boot>true</boot>
- <flags>/codepage:65001 /nologo /noconfig -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib -r:./../../../class/lib/basic/mscorlib.dll -optimize /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+ <flags>/codepage:65001 /nologo /noconfig -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib -r:./../../../class/lib/basic/mscorlib.dll -optimize /delaysign /keyfile:../../Open.snk /nowarn:1616,1699</flags>
<output>System.ValueTuple.dll</output>
<built_sources></built_sources>
<library_output>./../../../class/lib/basic/Facades/System.ValueTuple.dll</library_output>
<fx_version>4.5</fx_version>
<profile>build</profile>
<resources></resources>
- <response>System.dll.sources</response>
+ <response>./../../build/deps/build_System.dll.sources</response>
</project>
<project dir="class/System" library="System-bare-build">
<boot>false</boot>
<fx_version>4.5</fx_version>
<profile>build</profile>
<resources></resources>
- <response>System.dll.sources</response>
+ <response>./../../build/deps/build_System.dll.sources</response>
</project>
<project dir="class/System" library="System-secxml-build">
<boot>false</boot>
<fx_version>4.5</fx_version>
<profile>build</profile>
<resources></resources>
- <response>System.dll.sources</response>
+ <response>./../../build/deps/build_System.dll.sources</response>
</project>
<project dir="class/System.XML" library="System.Xml-build">
<boot>false</boot>
</project>
<project dir="class/System.Core" library="System.Core-build">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -nowarn:436 -d:NET_3_5 -nowarn:1720 -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT -r:./../../class/lib/build/System.dll -r:./../../class/lib/build/Mono.Posix.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -nowarn:436 -d:NET_3_5 -d:FEATURE_COMPILE,FEATURE_COMPILE_TO_METHODBUILDER,FEATURE_PDB_GENERATOR -r:./../../class/lib/build/System.dll -r:./../../class/lib/build/Mono.Posix.dll</flags>
<output>System.Core.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/build/System.Core.dll</library_output>
<resources></resources>
<response>./../../build/deps/build_System.Core.dll.sources</response>
</project>
- <project dir="class/System.Core" library="System.Core-plaincore-build">
- <boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -nowarn:436 -d:NET_3_5 -nowarn:1720 -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT -r:./../../class/lib/build/System.dll -r:./../../class/lib/build/Mono.Posix.dll</flags>
- <output>System.Core.dll</output>
- <built_sources></built_sources>
- <library_output>./../../class/lib/build/plaincore/System.Core.dll</library_output>
- <fx_version>4.5</fx_version>
- <profile>build</profile>
- <resources></resources>
- <response>./../../build/deps/build_System.Core.dll.sources</response>
- </project>
<project dir="class/System.ComponentModel.Composition.4.5" library="System.ComponentModel.Composition-build">
<boot>false</boot>
<flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -d:CLR40 -d:USE_ECMA_KEY,FEATURE_REFLECTIONCONTEXT,FEATURE_REFLECTIONFILEIO,FEATURE_SERIALIZATION,FEATURE_SLIMLOCK -nowarn:219,414 -nowarn:436 -r:./../../class/lib/build/System.dll -r:./../../class/lib/build/System.Core.dll</flags>
<resources></resources>
<response>Mono.Cecil.dll.sources</response>
</project>
+ <project dir="class/Mono.CompilerServices.SymbolWriter" library="Mono.CompilerServices.SymbolWriter-build">
+ <boot>true</boot>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -r:./../../class/lib/build/System.dll</flags>
+ <output>Mono.CompilerServices.SymbolWriter.dll</output>
+ <built_sources></built_sources>
+ <library_output>./../../class/lib/build/Mono.CompilerServices.SymbolWriter.dll</library_output>
+ <fx_version>4.5</fx_version>
+ <profile>build</profile>
+ <resources></resources>
+ <response>Mono.CompilerServices.SymbolWriter.dll.sources</response>
+ </project>
+ <project dir="class/PEAPI" library="PEAPI-build">
+ <boot>false</boot>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -nowarn:414,618 -r:./../../class/lib/build/System.dll</flags>
+ <output>PEAPI.dll</output>
+ <built_sources></built_sources>
+ <library_output>./../../class/lib/build/PEAPI.dll</library_output>
+ <fx_version>4.5</fx_version>
+ <profile>build</profile>
+ <resources></resources>
+ <response>PEAPI.dll.sources</response>
+ </project>
<project dir="tools/cil-stringreplacer" library="cil-stringreplacer-build">
<boot></boot>
<flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize -r:System -r:Mono.Cecil</flags>
</project>
<project dir="class/Facades/System.ValueTuple" library="Facades_System.ValueTuple-build">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/build/mscorlib.dll -optimize /delaysign /keyfile:../../Open.snk /nowarn:1616,1699</flags>
<output>System.ValueTuple.dll</output>
<built_sources></built_sources>
<library_output>./../../../class/lib/build/Facades/System.ValueTuple.dll</library_output>
<resources></resources>
<response>commoncryptogenerator.exe.sources</response>
</project>
+ <project dir="ilasm" library="ilasm-build">
+ <boot></boot>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../class/lib/build/mscorlib.dll -optimize -r:PEAPI -r:Mono.CompilerServices.SymbolWriter -r:Mono.Security</flags>
+ <output>ilasm.exe</output>
+ <built_sources>ILParser.cs</built_sources>
+ <library_output>./../class/lib/build/ilasm.exe</library_output>
+ <fx_version>4.5</fx_version>
+ <profile>build</profile>
+ <resources></resources>
+ <response>ilasm.exe.sources</response>
+ </project>
<project dir="class/corlib" library="corlib-net_4_x">
<boot>true</boot>
<flags>/codepage:65001 /nologo /noconfig /deterministic -unsafe -nostdlib -nowarn:612,618,1635 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib /debug:portable -optimize -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT,HAS_CORLIB_CONTRACTS -d:FEATURE_MACL -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -resource:resources/charinfo.nlp -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin -runtimemetadataversion:v4.0.30319</flags>
<fx_version>4.5</fx_version>
<profile>net_4_x</profile>
<resources></resources>
- <response>System.dll.sources</response>
+ <response>./../../build/deps/net_4_x_System.dll.sources</response>
</project>
<project dir="class/System" library="System-tests-net_4_x">
<boot>false</boot>
<fx_version>4.5</fx_version>
<profile>net_4_x</profile>
<resources></resources>
- <response>System.dll.sources</response>
+ <response>./../../build/deps/net_4_x_System.dll.sources</response>
</project>
<project dir="class/System" library="System-tests-net_4_x">
<boot>false</boot>
<fx_version>4.5</fx_version>
<profile>net_4_x</profile>
<resources></resources>
- <response>System.dll.sources</response>
+ <response>./../../build/deps/net_4_x_System.dll.sources</response>
</project>
<project dir="class/System" library="System-tests-net_4_x">
<boot>false</boot>
</project>
<project dir="class/System.Core" library="System.Core-net_4_x">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -nowarn:436 -d:NET_3_5 -nowarn:1720 -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Posix.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -nowarn:436 -d:NET_3_5 -d:FEATURE_COMPILE,FEATURE_COMPILE_TO_METHODBUILDER,FEATURE_PDB_GENERATOR -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Posix.dll</flags>
<output>System.Core.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/net_4_x/System.Core.dll</library_output>
</project>
<project dir="class/System.Core" library="System.Core-tests-net_4_x">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -r:./../../class/lib/net_4_x/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -nowarn:436 -d:NET_3_5 -nowarn:1720 -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Posix.dll</flags>
- <output>net_4_x_System.Core_test.dll</output>
- <built_sources></built_sources>
- <library_output>net_4_x_System.Core_test.dll</library_output>
- <fx_version>4.5</fx_version>
- <profile>net_4_x</profile>
- <resources></resources>
- <response>./../../build/deps/net_4_x_System.Core_test.dll.response</response>
- </project>
- <project dir="class/System.Core" library="System.Core-plaincore-net_4_x">
- <boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -nowarn:436 -d:NET_3_5 -nowarn:1720 -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Posix.dll</flags>
- <output>System.Core.dll</output>
- <built_sources></built_sources>
- <library_output>./../../class/lib/net_4_x/plaincore/System.Core.dll</library_output>
- <fx_version>4.5</fx_version>
- <profile>net_4_x</profile>
- <resources></resources>
- <response>./../../build/deps/net_4_x_System.Core.dll.sources</response>
- </project>
- <project dir="class/System.Core" library="System.Core-tests-net_4_x">
- <boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -r:./../../class/lib/net_4_x/plaincore/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -nowarn:436 -d:NET_3_5 -nowarn:1720 -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,FEATURE_PDBEMIT -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Posix.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -r:./../../class/lib/net_4_x/System.Core.dll -d:FEATURE_PAL,PFX_LEGACY_3_5,FEATURE_NETCORE -d:INSIDE_SYSCORE -d:LIBC -unsafe -nowarn:436 -d:NET_3_5 -d:FEATURE_COMPILE,FEATURE_COMPILE_TO_METHODBUILDER,FEATURE_PDB_GENERATOR -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Posix.dll</flags>
<output>net_4_x_System.Core_test.dll</output>
<built_sources></built_sources>
<library_output>net_4_x_System.Core_test.dll</library_output>
</project>
<project dir="class/System.IO.Compression" library="System.IO.Compression-net_4_x">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize /unsafe -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.Core.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -r:./../../class/lib/net_4_x/System.dll</flags>
<output>System.IO.Compression.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/net_4_x/System.IO.Compression.dll</library_output>
</project>
<project dir="class/System.IO.Compression.FileSystem" library="System.IO.Compression.FileSystem-net_4_x">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.IO.Compression.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -unsafe -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.IO.Compression.dll</flags>
<output>System.IO.Compression.FileSystem.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/net_4_x/System.IO.Compression.FileSystem.dll</library_output>
</project>
<project dir="class/System.Drawing" library="System.Drawing-net_4_x">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize /unsafe -d:FEATURE_TYPECONVERTER -resource:Assembly/Mono.ico,Mono.ico -resource:Assembly/Information.ico,Information.ico -resource:Assembly/Error.ico,Error.ico -resource:Assembly/Warning.ico,Warning.ico -resource:Assembly/Question.ico,Question.ico -resource:Assembly/Shield.ico,Shield.ico -r:./../../class/lib/net_4_x/System.dll</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize /unsafe -resource:Assembly/Mono.ico,Mono.ico -resource:Assembly/Information.ico,Information.ico -resource:Assembly/Error.ico,Error.ico -resource:Assembly/Warning.ico,Warning.ico -resource:Assembly/Question.ico,Question.ico -resource:Assembly/Shield.ico,Shield.ico -d:FEATURE_TYPECONVERTER,SUPPORTS_WINDOWS_COLORS -r:./../../class/lib/net_4_x/System.dll</flags>
<output>System.Drawing.dll</output>
<built_sources></built_sources>
<library_output>./../../class/lib/net_4_x/System.Drawing.dll</library_output>
</project>
<project dir="class/System.Drawing" library="System.Drawing-tests-net_4_x">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -r:./../../class/lib/net_4_x/System.Drawing.dll /unsafe -d:FEATURE_TYPECONVERTER -resource:Assembly/Mono.ico,Mono.ico -resource:Assembly/Information.ico,Information.ico -resource:Assembly/Error.ico,Error.ico -resource:Assembly/Warning.ico,Warning.ico -resource:Assembly/Question.ico,Question.ico -resource:Assembly/Shield.ico,Shield.ico -r:./../../class/lib/net_4_x/System.dll -define:TEST -resource:Test/resources/indexed.png,indexed.png -nowarn:0618 -nowarn:219 -nowarn:169</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -r:./../../class/lib/net_4_x/System.Drawing.dll /unsafe -resource:Assembly/Mono.ico,Mono.ico -resource:Assembly/Information.ico,Information.ico -resource:Assembly/Error.ico,Error.ico -resource:Assembly/Warning.ico,Warning.ico -resource:Assembly/Question.ico,Question.ico -resource:Assembly/Shield.ico,Shield.ico -d:FEATURE_TYPECONVERTER,SUPPORTS_WINDOWS_COLORS -r:./../../class/lib/net_4_x/System.dll -define:TEST -resource:Test/resources/indexed.png,indexed.png -nowarn:0618 -nowarn:219 -nowarn:169</flags>
<output>net_4_x_System.Drawing_test.dll</output>
<built_sources></built_sources>
<library_output>net_4_x_System.Drawing_test.dll</library_output>
</project>
<project dir="class/Facades/System.ValueTuple" library="Facades_System.ValueTuple-net_4_x">
<boot>false</boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize /delaysign /keyfile:../../msfinal.pub /nowarn:1616,1699</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../../class/lib/net_4_x/mscorlib.dll -optimize /delaysign /keyfile:../../Open.snk /nowarn:1616,1699</flags>
<output>System.ValueTuple.dll</output>
<built_sources></built_sources>
<library_output>./../../../class/lib/net_4_x/Facades/System.ValueTuple.dll</library_output>
</project>
<project dir="ilasm" library="ilasm-net_4_x">
<boot></boot>
- <flags>/codepage:65001 /nologo /noconfig /deterministic /lib:../class/lib/net_4_x /r:../class/lib/net_4_x/PEAPI.dll /r:Mono.CompilerServices.SymbolWriter.dll /r:Mono.Security.dll -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize</flags>
+ <flags>/codepage:65001 /nologo /noconfig /deterministic -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../class/lib/net_4_x/mscorlib.dll /debug:portable -optimize -r:PEAPI -r:Mono.CompilerServices.SymbolWriter -r:Mono.Security</flags>
<output>ilasm.exe</output>
<built_sources>ILParser.cs</built_sources>
<library_output>./../class/lib/net_4_x/ilasm.exe</library_output>
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Core-net_4_x", "mcs/class/System.Core/System.Core-net_4_x.csproj", "{359142A1-D80F-401E-AA64-7167C9317649}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Core-plaincore-net_4_x", "mcs/class/System.Core/System.Core-plaincore-net_4_x.csproj", "{1EC0EBC0-0B35-454C-89AE-3F8F0FDD9705}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resgen-net_4_x", "mcs/tools/resgen/resgen-net_4_x.csproj", "{647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Compression-net_4_x", "mcs/class/System.IO.Compression/System.IO.Compression-net_4_x.csproj", "{6187D26C-54C8-4298-829E-A99B0E6036B1}"
{359142A1-D80F-401E-AA64-7167C9317649}.Debug|Any CPU.Build.0 = Debug|Any CPU
{359142A1-D80F-401E-AA64-7167C9317649}.Release|Any CPU.ActiveCfg = Release|Any CPU
{359142A1-D80F-401E-AA64-7167C9317649}.Release|Any CPU.Build.0 = Release|Any CPU
- {1EC0EBC0-0B35-454C-89AE-3F8F0FDD9705}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1EC0EBC0-0B35-454C-89AE-3F8F0FDD9705}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1EC0EBC0-0B35-454C-89AE-3F8F0FDD9705}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1EC0EBC0-0B35-454C-89AE-3F8F0FDD9705}.Release|Any CPU.Build.0 = Release|Any CPU
{647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{647DC12E-A4EE-424A-9EC7-CE6643EE2EF7}.Release|Any CPU.ActiveCfg = Release|Any CPU