1 // -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
6 // Miguel de Icaza (miguel@ximian.com)
8 // (C) Ximian, Inc. http://www.ximian.com
11 using System.Globalization;
15 public struct Char : IComparable, IFormattable {
16 public const char MinValue = (char) 0;
17 public const char MaxValue = (char) 0xffff;
19 // VES needs to know about value. public is workaround
20 // so source will compile
23 public int CompareTo (object v)
25 if (!(v is System.Byte))
26 throw new ArgumentException ("Value is not a System.Byte");
28 return value - ((byte) v);
31 public override bool Equals (object o)
33 if (!(o is System.Byte))
36 return ((byte) o) == value;
39 public override int GetHashCode ()
44 public static double GetNumericValue (char c)
46 if ((c >= 48) && (c <= 57))
47 return (double) (c - '0');
51 public static double GetNumericValue (string s, int index)
53 /* FIXME: implement me */
57 public static bool IsControl (char c)
59 return ((c > 1) && (c < 32));
62 public static bool IsDigit (char c)
64 return ((c >= '0') && (c <= '9'));
67 public static bool IsLetter (char c)
70 * FIXME: This is broken, it should support
71 * the various categories in System.Globalization.UnicodeCategory
73 return ((c >= 65) && (c <= 126));
76 public TypeCode GetTypeCode ()
81 public static char Parse (string s)
87 public static char Parse (string s, IFormatProvider fp)
93 public static char Parse (string s, NumberStyles style, IFormatProvider fp)
99 public static char ToLower (char c)
101 // FIXME: make me unicode aware
102 return (c >= 'A' && c <= 'Z') ? (char) (c + 33) : c;
105 public static char ToUpper (char c)
107 // FIXME: make me unicode aware
108 return (char) ((c >= 'a' && c <= 'z') ? c - 33 : c);
111 public override string ToString ()
113 // TODO: Implement me
118 public string ToString (IFormatProvider fp)
120 // TODO: Implement me.
124 public string ToString (string format)
126 // TODO: Implement me.
130 public string ToString (string format, IFormatProvider fp)
132 // TODO: Implement me.