Author: atsushi
Date: 2005-11-14 19:06:58 -0500 (Mon, 14 Nov 2005)
New Revision: 53035
Added:
trunk/mcs/class/corlib/System.Text/DecoderExceptionFallback.cs
trunk/mcs/class/corlib/System.Text/DecoderExceptionFallbackBuffer.cs
trunk/mcs/class/corlib/System.Text/DecoderFallback.cs
trunk/mcs/class/corlib/System.Text/DecoderFallbackBuffer.cs
trunk/mcs/class/corlib/System.Text/DecoderFallbackException.cs
trunk/mcs/class/corlib/System.Text/DecoderReplacementFallback.cs
trunk/mcs/class/corlib/System.Text/DecoderReplacementFallbackBuffer.cs
Modified:
trunk/mcs/class/corlib/ChangeLog
trunk/mcs/class/corlib/System.Text/ChangeLog
trunk/mcs/class/corlib/corlib.dll.sources
Log:
2005-11-14 Atsushi Enomoto <[EMAIL PROTECTED]>
* DecoderFallbackBuffer.cs, DecoderFallback.cs,
DecoderExceptionFallbackBuffer.cs,
DecoderReplacementFallbackBuffer.cs,
DecoderFallbackException.cs,
DecoderExceptionFallback.cs,
DecoderReplacementFallback.cs : new files (not actually used yet).
* corlib.dll.sources: added new .NET 2.0 Decoder support types in
System.Text.
Modified: trunk/mcs/class/corlib/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/ChangeLog 2005-11-14 22:55:31 UTC (rev 53034)
+++ trunk/mcs/class/corlib/ChangeLog 2005-11-15 00:06:58 UTC (rev 53035)
@@ -1,3 +1,8 @@
+2005-11-14 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * corlib.dll.sources: added new .NET 2.0 Decoder support types in
+ System.Text.
+
2005-11-06 Zoltan Varga <[EMAIL PROTECTED]>
* corlib.dll.sources: Add System.IO/SearchOption.cs.
Modified: trunk/mcs/class/corlib/System.Text/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Text/ChangeLog 2005-11-14 22:55:31 UTC
(rev 53034)
+++ trunk/mcs/class/corlib/System.Text/ChangeLog 2005-11-15 00:06:58 UTC
(rev 53035)
@@ -1,3 +1,12 @@
+2005-11-14 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * 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 <[EMAIL PROTECTED]>
* ASCIIEncoding.cs, Encoding: Another snack, just a few methods
Added: trunk/mcs/class/corlib/System.Text/DecoderExceptionFallback.cs
===================================================================
--- trunk/mcs/class/corlib/System.Text/DecoderExceptionFallback.cs
2005-11-14 22:55:31 UTC (rev 53034)
+++ trunk/mcs/class/corlib/System.Text/DecoderExceptionFallback.cs
2005-11-15 00:06:58 UTC (rev 53035)
@@ -0,0 +1,61 @@
+//
+// DecoderExceptionFallback.cs
+//
+// Author:
+// Atsushi Enomoto <[EMAIL PROTECTED]>
+//
+
+//
+// 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
Property changes on:
trunk/mcs/class/corlib/System.Text/DecoderExceptionFallback.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/corlib/System.Text/DecoderExceptionFallbackBuffer.cs
===================================================================
--- trunk/mcs/class/corlib/System.Text/DecoderExceptionFallbackBuffer.cs
2005-11-14 22:55:31 UTC (rev 53034)
+++ trunk/mcs/class/corlib/System.Text/DecoderExceptionFallbackBuffer.cs
2005-11-15 00:06:58 UTC (rev 53035)
@@ -0,0 +1,63 @@
+//
+// DecoderExceptionFallbackBuffer.cs
+//
+// Author:
+// Atsushi Enomoto <[EMAIL PROTECTED]>
+//
+
+//
+// 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
Property changes on:
trunk/mcs/class/corlib/System.Text/DecoderExceptionFallbackBuffer.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/corlib/System.Text/DecoderFallback.cs
===================================================================
--- trunk/mcs/class/corlib/System.Text/DecoderFallback.cs 2005-11-14
22:55:31 UTC (rev 53034)
+++ trunk/mcs/class/corlib/System.Text/DecoderFallback.cs 2005-11-15
00:06:58 UTC (rev 53035)
@@ -0,0 +1,60 @@
+//
+// DecoderFallback.cs
+//
+// Author:
+// Atsushi Enomoto <[EMAIL PROTECTED]>
+//
+
+//
+// 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
Property changes on: trunk/mcs/class/corlib/System.Text/DecoderFallback.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/corlib/System.Text/DecoderFallbackBuffer.cs
===================================================================
--- trunk/mcs/class/corlib/System.Text/DecoderFallbackBuffer.cs 2005-11-14
22:55:31 UTC (rev 53034)
+++ trunk/mcs/class/corlib/System.Text/DecoderFallbackBuffer.cs 2005-11-15
00:06:58 UTC (rev 53035)
@@ -0,0 +1,57 @@
+//
+// DecoderFallbackBuffer.cs
+//
+// Author:
+// Atsushi Enomoto <[EMAIL PROTECTED]>
+//
+
+//
+// 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
Property changes on: trunk/mcs/class/corlib/System.Text/DecoderFallbackBuffer.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/corlib/System.Text/DecoderFallbackException.cs
===================================================================
--- trunk/mcs/class/corlib/System.Text/DecoderFallbackException.cs
2005-11-14 22:55:31 UTC (rev 53034)
+++ trunk/mcs/class/corlib/System.Text/DecoderFallbackException.cs
2005-11-15 00:06:58 UTC (rev 53035)
@@ -0,0 +1,78 @@
+//
+// DecoderFallbackException.cs
+//
+// Author:
+// Atsushi Enomoto <[EMAIL PROTECTED]>
+//
+
+//
+// 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
Property changes on:
trunk/mcs/class/corlib/System.Text/DecoderFallbackException.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/corlib/System.Text/DecoderReplacementFallback.cs
===================================================================
--- trunk/mcs/class/corlib/System.Text/DecoderReplacementFallback.cs
2005-11-14 22:55:31 UTC (rev 53034)
+++ trunk/mcs/class/corlib/System.Text/DecoderReplacementFallback.cs
2005-11-15 00:06:58 UTC (rev 53035)
@@ -0,0 +1,86 @@
+//
+// DecoderReplacementFallback.cs
+//
+// Author:
+// Atsushi Enomoto <[EMAIL PROTECTED]>
+//
+
+//
+// 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
Property changes on:
trunk/mcs/class/corlib/System.Text/DecoderReplacementFallback.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/class/corlib/System.Text/DecoderReplacementFallbackBuffer.cs
===================================================================
--- trunk/mcs/class/corlib/System.Text/DecoderReplacementFallbackBuffer.cs
2005-11-14 22:55:31 UTC (rev 53034)
+++ trunk/mcs/class/corlib/System.Text/DecoderReplacementFallbackBuffer.cs
2005-11-15 00:06:58 UTC (rev 53035)
@@ -0,0 +1,71 @@
+//
+// DecoderReplacementFallbackBuffer.cs
+//
+// Author:
+// Atsushi Enomoto <[EMAIL PROTECTED]>
+//
+
+//
+// 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
Property changes on:
trunk/mcs/class/corlib/System.Text/DecoderReplacementFallbackBuffer.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/mcs/class/corlib/corlib.dll.sources
===================================================================
--- trunk/mcs/class/corlib/corlib.dll.sources 2005-11-14 22:55:31 UTC (rev
53034)
+++ trunk/mcs/class/corlib/corlib.dll.sources 2005-11-15 00:06:58 UTC (rev
53035)
@@ -1242,6 +1242,13 @@
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
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches