+2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
+
+ * corlib.dll.sources: added new .NET 2.0 Decoder support types in
+ System.Text.
+
2005-11-06 Zoltan Varga <vargaz@freemail.hu>
* corlib.dll.sources: Add System.IO/SearchOption.cs.
+2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DecoderFallbackBuffer.cs, DecoderFallback.cs,
+ DecoderExceptionFallbackBuffer.cs,
+ DecoderReplacementFallbackBuffer.cs,
+ DecoderFallbackException.cs,
+ DecoderExceptionFallback.cs,
+ DecoderReplacementFallback.cs : new files (not actually used yet).
+
2005-11-14 Miguel de Icaza <miguel@novell.com>
* ASCIIEncoding.cs, Encoding: Another snack, just a few methods
--- /dev/null
+//
+// DecoderExceptionFallback.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+
+//
+// Copyright (C) 2005 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.
+//
+#if NET_2_0
+
+namespace System.Text
+{
+ public class DecoderExceptionFallback : DecoderFallback
+ {
+ public DecoderExceptionFallback ()
+ {
+ }
+
+ public override int MaxCharCount {
+ get { return 0; }
+ }
+
+ public override DecoderFallbackBuffer CreateFallbackBuffer ()
+ {
+ return new DecoderExceptionFallbackBuffer ();
+ }
+
+ public override bool Equals (object value)
+ {
+ return value as DecoderExceptionFallback != null;
+ }
+
+ public override int GetHashCode ()
+ {
+ return 0;
+ }
+ }
+}
+
+#endif
--- /dev/null
+//
+// DecoderExceptionFallbackBuffer.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+
+//
+// Copyright (C) 2005 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.
+//
+
+#if NET_2_0
+
+namespace System.Text
+{
+ public sealed class DecoderExceptionFallbackBuffer
+ : DecoderFallbackBuffer
+ {
+ public DecoderExceptionFallbackBuffer ()
+ {
+ }
+
+ public override int Remaining {
+ get { return 0; }
+ }
+
+ public override bool Fallback (byte [] bytesUnknown, int index)
+ {
+ throw new DecoderFallbackException (null, bytesUnknown, index);
+ }
+
+ public override char GetNextChar ()
+ {
+ return char.MinValue;
+ }
+
+ public override bool MovePrevious ()
+ {
+ return false;
+ }
+ }
+}
+
+#endif
--- /dev/null
+//
+// DecoderFallback.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+
+//
+// Copyright (C) 2005 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.
+//
+
+#if NET_2_0
+
+namespace System.Text
+{
+ public abstract class DecoderFallback
+ {
+ static DecoderFallback exception_fallback =
+ new DecoderExceptionFallback ();
+ static DecoderFallback replacement_fallback =
+ new DecoderReplacementFallback ();
+
+ protected DecoderFallback ()
+ {
+ }
+
+ public static DecoderFallback ExceptionFallback {
+ get { return exception_fallback; }
+ }
+
+ public abstract int MaxCharCount { get; }
+
+ public static DecoderFallback ReplacementFallback {
+ get { return replacement_fallback; }
+ }
+
+ public abstract DecoderFallbackBuffer CreateFallbackBuffer ();
+ }
+}
+
+#endif
--- /dev/null
+//
+// DecoderFallbackBuffer.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+
+//
+// Copyright (C) 2005 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.
+//
+
+#if NET_2_0
+
+namespace System.Text
+{
+ public abstract class DecoderFallbackBuffer
+ {
+ protected DecoderFallbackBuffer ()
+ {
+ }
+
+ public abstract int Remaining { get; }
+
+ public abstract bool Fallback (byte [] bytesUnknown, int index);
+
+ public abstract char GetNextChar ();
+
+ public abstract bool MovePrevious ();
+
+ [MonoTODO]
+ public virtual void Reset ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
+#endif
--- /dev/null
+//
+// DecoderFallbackException.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+
+//
+// Copyright (C) 2005 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.
+//
+
+#if NET_2_0
+
+namespace System.Text
+{
+ public sealed class DecoderFallbackException : ArgumentException
+ {
+ const string defaultMessage =
+ "Failed to decode the input byte sequence to Unicode characters.";
+
+ public DecoderFallbackException ()
+ : this (null)
+ {
+ }
+
+ public DecoderFallbackException (string message)
+ : base (message)
+ {
+ }
+
+ public DecoderFallbackException (string message, Exception innerException)
+ : base (message, innerException)
+ {
+ }
+
+ public DecoderFallbackException (string message,
+ byte [] bytesUnknown, int index)
+ : base (message)
+ {
+ bytes_unknown = bytesUnknown;
+ this.index = index;
+ }
+
+ byte [] bytes_unknown;
+ int index = - 1;
+
+ [MonoTODO]
+ public byte [] BytesUnknown {
+ get { return bytes_unknown; }
+ }
+
+ [MonoTODO]
+ public int Index {
+ get { return index; }
+ }
+ }
+}
+
+#endif
--- /dev/null
+//
+// DecoderReplacementFallback.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+
+//
+// Copyright (C) 2005 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.
+//
+
+#if NET_2_0
+
+namespace System.Text
+{
+ public class DecoderReplacementFallback : DecoderFallback
+ {
+ [MonoTODO]
+ public DecoderReplacementFallback ()
+ : this ("?")
+ {
+ }
+
+ [MonoTODO]
+ public DecoderReplacementFallback (string replacement)
+ {
+ if (replacement == null)
+ throw new ArgumentNullException ();
+ // FIXME: check replacement validity (invalid surrogate)
+
+ this.replacement = replacement;
+ }
+
+ string replacement;
+
+ [MonoTODO]
+ public string DefaultString {
+ get { return replacement; }
+ }
+
+ [MonoTODO]
+ public override int MaxCharCount {
+ get { return replacement.Length; }
+ }
+
+ [MonoTODO]
+ public override DecoderFallbackBuffer CreateFallbackBuffer ()
+ {
+ return new DecoderReplacementFallbackBuffer (this);
+ }
+
+ [MonoTODO]
+ public override bool Equals (object value)
+ {
+ DecoderReplacementFallback f = value as DecoderReplacementFallback;
+ return f != null && replacement == f.replacement;
+ }
+
+ [MonoTODO]
+ public override int GetHashCode ()
+ {
+ return replacement.GetHashCode ();
+ }
+ }
+}
+
+#endif
--- /dev/null
+//
+// DecoderReplacementFallbackBuffer.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+
+//
+// Copyright (C) 2005 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.
+//
+
+#if NET_2_0
+
+namespace System.Text
+{
+ public sealed class DecoderReplacementFallbackBuffer
+ : DecoderFallbackBuffer
+ {
+ DecoderReplacementFallback fallback;
+
+ public DecoderReplacementFallbackBuffer (
+ DecoderReplacementFallback fallback)
+ {
+ this.fallback = fallback;
+ }
+
+ [MonoTODO]
+ public override int Remaining {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override bool Fallback (byte [] bytesUnknown, int index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override char GetNextChar ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override bool MovePrevious ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
+#endif
System.Security.Principal/WindowsPrincipal.cs
System.Text/ASCIIEncoding.cs
System.Text/Decoder.cs
+System.Text/DecoderExceptionFallback.cs
+System.Text/DecoderExceptionFallbackBuffer.cs
+System.Text/DecoderFallback.cs
+System.Text/DecoderFallbackBuffer.cs
+System.Text/DecoderFallbackException.cs
+System.Text/DecoderReplacementFallback.cs
+System.Text/DecoderReplacementFallbackBuffer.cs
System.Text/Encoder.cs
System.Text/Encoding.cs
System.Text/Latin1Encoding.cs