2003-12-06 Dick Porter <dick@ximian.com>
[mono.git] / mcs / class / corlib / System.Globalization / TextInfo.cs
1 //
2 // System.Globalization.TextInfo.cs
3 //
4 // Author:
5 //      Dick Porter (dick@ximian.com)
6 //      Duncan Mak (duncan@ximian.com)
7 //
8 // (C) 2002 Ximian, Inc.
9 //
10
11 using System.Globalization;
12 using System.Runtime.Serialization;
13
14 namespace System.Globalization {
15
16         [Serializable]
17         public class TextInfo: IDeserializationCallback
18         {
19                 private int lcid;
20                 
21                 internal TextInfo ()
22                 {
23                 }
24
25                 internal TextInfo (int lcid)
26                 {
27                         this.lcid=lcid;
28                 }
29
30                 [MonoTODO]
31                 public virtual int ANSICodePage
32                 {
33                         get {
34                                 return(0);
35                         }
36                 }
37
38                 [MonoTODO]
39                 public virtual int EBCDICCodePage
40                 {
41                         get {
42                                 return(0);
43                         }
44                 }
45                 
46                 [MonoTODO]
47                 public virtual string ListSeparator 
48                 {
49                         get {
50                                 return(",");
51                         }
52                 }
53
54                 [MonoTODO]
55                 public virtual int MacCodePage
56                 {
57                         get {
58                                 return(0);
59                         }
60                 }
61                 
62                 [MonoTODO]
63                 public virtual int OEMCodePage
64                 {
65                         get {
66                                 return(0);
67                         }
68                 }
69
70                 [MonoTODO]
71                 public override bool Equals(object obj)
72                 {
73                         throw new NotImplementedException();
74                 }
75
76                 public override int GetHashCode()
77                 {
78                         return(lcid);
79                 }
80
81                 [MonoTODO]
82                 public virtual char ToLower(char c)
83                 {
84                         return Char.ToLower (c);
85                 }
86                 
87                 [MonoTODO]
88                 public virtual string ToLower(string str)
89                 {
90                         if(str==null) {
91                                 throw new ArgumentNullException("string is null");
92                         }
93                         
94                         Text.StringBuilder s = new Text.StringBuilder ();
95
96                         foreach (char c in str) {
97                                 s.Append (Char.ToLower (c));
98                         }
99
100                         return s.ToString ();
101                 }
102                 
103                 [MonoTODO]
104                 public override string ToString()
105                 {
106                         return("TextInfo");
107                 }
108
109                 public string ToTitleCase (string str)
110                 {
111                         if(str == null)
112                                 throw new ArgumentNullException("string is null");
113                         
114                         Text.StringBuilder s = new Text.StringBuilder ();
115
116                         s.Append (Char.ToUpper (str [0]));
117
118                         for (int i = 1; i < str.Length; i ++)
119                                 s.Append (str [i]);
120
121                         return s.ToString ();
122                 }
123
124                 [MonoTODO]
125                 public virtual char ToUpper(char c)
126                 {
127                         return('X');
128                 }
129
130                 [MonoTODO]
131                 public virtual string ToUpper(string str)
132                 {
133                         if(str==null) {
134                                 throw new ArgumentNullException("string is null");
135                         }
136                         
137                         return("");
138                 }
139
140                 /* IDeserialization interface */
141                 [MonoTODO]
142                 void IDeserializationCallback.OnDeserialization(object sender)
143                 {
144                 }
145         }
146 }