2004-04-30 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 m_win32LangID;
20                 int m_nDataItem;
21                 bool m_useUserOverride;
22                 
23                 internal TextInfo ()
24                 {
25                 }
26
27                 internal TextInfo (int lcid)
28                 {
29                         this.m_win32LangID=lcid;
30                 }
31
32                 [MonoTODO]
33                 public virtual int ANSICodePage
34                 {
35                         get {
36                                 return(0);
37                         }
38                 }
39
40                 [MonoTODO]
41                 public virtual int EBCDICCodePage
42                 {
43                         get {
44                                 return(0);
45                         }
46                 }
47                 
48                 [MonoTODO]
49                 public virtual string ListSeparator 
50                 {
51                         get {
52                                 return(",");
53                         }
54                 }
55
56                 [MonoTODO]
57                 public virtual int MacCodePage
58                 {
59                         get {
60                                 return(0);
61                         }
62                 }
63                 
64                 [MonoTODO]
65                 public virtual int OEMCodePage
66                 {
67                         get {
68                                 return(0);
69                         }
70                 }
71
72                 [MonoTODO]
73                 public override bool Equals(object obj)
74                 {
75                         throw new NotImplementedException();
76                 }
77
78                 public override int GetHashCode()
79                 {
80                         return(m_win32LangID);
81                 }
82
83                 [MonoTODO]
84                 public virtual char ToLower(char c)
85                 {
86                         return Char.ToLower (c);
87                 }
88                 
89                 [MonoTODO]
90                 public virtual string ToLower(string str)
91                 {
92                         if(str==null) {
93                                 throw new ArgumentNullException("string is null");
94                         }
95                         
96                         Text.StringBuilder s = new Text.StringBuilder ();
97
98                         foreach (char c in str) {
99                                 s.Append (Char.ToLower (c));
100                         }
101
102                         return s.ToString ();
103                 }
104                 
105                 [MonoTODO]
106                 public override string ToString()
107                 {
108                         return("TextInfo");
109                 }
110
111                 public string ToTitleCase (string str)
112                 {
113                         if(str == null)
114                                 throw new ArgumentNullException("string is null");
115                         
116                         Text.StringBuilder s = new Text.StringBuilder ();
117
118                         s.Append (Char.ToUpper (str [0]));
119
120                         for (int i = 1; i < str.Length; i ++)
121                                 s.Append (str [i]);
122
123                         return s.ToString ();
124                 }
125
126                 [MonoTODO]
127                 public virtual char ToUpper(char c)
128                 {
129                         return('X');
130                 }
131
132                 [MonoTODO]
133                 public virtual string ToUpper(string str)
134                 {
135                         if(str==null) {
136                                 throw new ArgumentNullException("string is null");
137                         }
138                         
139                         return("");
140                 }
141
142                 /* IDeserialization interface */
143                 [MonoTODO]
144                 void IDeserializationCallback.OnDeserialization(object sender)
145                 {
146                 }
147         }
148 }