Delete moved file
authorJan Kotas <jkotas@microsoft.com>
Fri, 24 Mar 2017 20:16:39 +0000 (13:16 -0700)
committerJan Kotas <jkotas@microsoft.com>
Fri, 24 Mar 2017 20:20:07 +0000 (13:20 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/40c4c3c866fd08842710f38ddc3998e8d214aa1c

src/coreclr/src/mscorlib/System.Private.CoreLib.csproj
src/coreclr/src/mscorlib/src/System/DBNull.cs [deleted file]
src/coreclr/src/mscorlib/src/System/Text/StringBuilder.CoreCLR.cs

index 7101f5f..1dce811 100644 (file)
     <Compile Include="$(BclSourcesRoot)\System\TypeUnloadedException.cs" />
     <Compile Include="$(BclSourcesRoot)\System\CompatibilitySwitches.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Currency.cs" />
-    <Compile Include="$(BclSourcesRoot)\System\DBNull.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Decimal.cs" />
     <Compile Include="$(BclSourcesRoot)\System\DefaultBinder.CanConvert.cs" />
     <Compile Include="$(BclSourcesRoot)\System\DelegateSerializationHolder.cs" />
diff --git a/src/coreclr/src/mscorlib/src/System/DBNull.cs b/src/coreclr/src/mscorlib/src/System/DBNull.cs
deleted file mode 100644 (file)
index 0b859e7..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-////////////////////////////////////////////////////////////////////////////////
-// Void
-//    This class represents a Missing Variant
-////////////////////////////////////////////////////////////////////////////////
-
-using System;
-using System.Runtime.Remoting;
-using System.Runtime.Serialization;
-
-namespace System
-{
-    [Serializable]
-    public sealed class DBNull : ISerializable, IConvertible
-    {
-        //Package private constructor
-        private DBNull()
-        {
-        }
-
-        private DBNull(SerializationInfo info, StreamingContext context)
-        {
-            throw new NotSupportedException(SR.NotSupported_DBNullSerial);
-        }
-
-        public static readonly DBNull Value = new DBNull();
-
-        public void GetObjectData(SerializationInfo info, StreamingContext context)
-        {
-            UnitySerializationHolder.GetUnitySerializationInfo(info, UnitySerializationHolder.NullUnity, null, null);
-        }
-
-        public override String ToString()
-        {
-            return String.Empty;
-        }
-
-        public String ToString(IFormatProvider provider)
-        {
-            return String.Empty;
-        }
-
-        public TypeCode GetTypeCode()
-        {
-            return TypeCode.DBNull;
-        }
-
-        /// <internalonly/>
-        bool IConvertible.ToBoolean(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        char IConvertible.ToChar(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        sbyte IConvertible.ToSByte(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        byte IConvertible.ToByte(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        short IConvertible.ToInt16(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        ushort IConvertible.ToUInt16(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        int IConvertible.ToInt32(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        uint IConvertible.ToUInt32(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        long IConvertible.ToInt64(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        ulong IConvertible.ToUInt64(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        float IConvertible.ToSingle(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        double IConvertible.ToDouble(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        decimal IConvertible.ToDecimal(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        DateTime IConvertible.ToDateTime(IFormatProvider provider)
-        {
-            throw new InvalidCastException(SR.InvalidCast_FromDBNull);
-        }
-
-        /// <internalonly/>
-        Object IConvertible.ToType(Type type, IFormatProvider provider)
-        {
-            return Convert.DefaultToType((IConvertible)this, type, provider);
-        }
-    }
-}
-
index 25a95f9..db3895f 100644 (file)
@@ -13,5 +13,36 @@ namespace System.Text
 
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
         internal unsafe extern void ReplaceBufferAnsiInternal(sbyte* newBuffer, int newLength);
+
+        // Copies the source StringBuilder to the destination IntPtr memory allocated with len bytes.
+        internal unsafe void InternalCopy(IntPtr dest, int len)
+        {
+            if (len == 0)
+                return;
+
+            bool isLastChunk = true;
+            byte* dstPtr = (byte*)dest.ToPointer();
+            StringBuilder currentSrc = FindChunkForByte(len);
+
+            do
+            {
+                int chunkOffsetInBytes = currentSrc.m_ChunkOffset * sizeof(char);
+                int chunkLengthInBytes = currentSrc.m_ChunkLength * sizeof(char);
+                fixed (char* charPtr = &currentSrc.m_ChunkChars[0])
+                {
+                    byte* srcPtr = (byte*)charPtr;
+                    if (isLastChunk)
+                    {
+                        isLastChunk = false;
+                        Buffer.Memcpy(dstPtr + chunkOffsetInBytes, srcPtr, len - chunkOffsetInBytes);
+                    }
+                    else
+                    {
+                        Buffer.Memcpy(dstPtr + chunkOffsetInBytes, srcPtr, chunkLengthInBytes);
+                    }
+                }
+                currentSrc = currentSrc.m_ChunkPrevious;
+            } while (currentSrc != null);
+        }
     }
 }