CompareInfo.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. //
  2. // System.Globalization.CompareInfo
  3. //
  4. // Authors:
  5. // Rodrigo Moya ([email protected])
  6. //
  7. // (C) Ximian, Inc. 2002
  8. //
  9. using System.Reflection;
  10. using System.Runtime.Serialization;
  11. namespace System.Globalization
  12. {
  13. [Serializable]
  14. public class CompareInfo : IDeserializationCallback
  15. {
  16. /* Hide the .ctor() */
  17. CompareInfo() {}
  18. public virtual int Compare (string string1, string string2)
  19. {
  20. return Compare (string1, string2, CompareOptions.None);
  21. }
  22. [MonoTODO]
  23. public virtual int Compare (string string1, string string2, CompareOptions options)
  24. {
  25. throw new NotImplementedException ();
  26. }
  27. public virtual int Compare (string string1, int offset1, string string2, int offset2)
  28. {
  29. return Compare (string1, offset1, string2, offset2, CompareOptions.None);
  30. }
  31. [MonoTODO]
  32. public virtual int Compare (string string1, int offset1, string string2, int offset2, CompareOptions options)
  33. {
  34. throw new NotImplementedException ();
  35. }
  36. public virtual int Compare (string string1, int offset1, int length1, string string2, int offset2, int length2)
  37. {
  38. return Compare (string1, offset1, length1, string2, offset2, length2, CompareOptions.None);
  39. }
  40. [MonoTODO]
  41. public virtual int Compare (string string1, int offset1, int length1, string string2, int offset2, int length2, CompareOptions options)
  42. {
  43. throw new NotImplementedException ();
  44. }
  45. [MonoTODO]
  46. public override bool Equals(object value)
  47. {
  48. throw new NotImplementedException();
  49. }
  50. [MonoTODO]
  51. public static CompareInfo GetCompareInfo(int culture)
  52. {
  53. throw new NotImplementedException();
  54. }
  55. [MonoTODO]
  56. public static CompareInfo GetCompareInfo(string name)
  57. {
  58. if(name == null) {
  59. throw new ArgumentNullException("name is null");
  60. }
  61. throw new NotImplementedException();
  62. }
  63. [MonoTODO]
  64. public static CompareInfo GetCompareInfo(int culture, Assembly assembly)
  65. {
  66. if(assembly == null) {
  67. throw new ArgumentNullException("assembly is null");
  68. }
  69. throw new NotImplementedException();
  70. }
  71. [MonoTODO]
  72. public static CompareInfo GetCompareInfo(string name, Assembly assembly)
  73. {
  74. if(name == null) {
  75. throw new ArgumentNullException("name is null");
  76. }
  77. if(assembly == null) {
  78. throw new ArgumentNullException("assembly is null");
  79. }
  80. throw new NotImplementedException();
  81. }
  82. [MonoTODO]
  83. public override int GetHashCode()
  84. {
  85. throw new NotImplementedException();
  86. }
  87. [MonoTODO]
  88. public virtual SortKey GetSortKey(string source)
  89. {
  90. throw new NotImplementedException();
  91. }
  92. [MonoTODO]
  93. public virtual SortKey GetSortKey(string source,
  94. CompareOptions options)
  95. {
  96. throw new NotImplementedException();
  97. }
  98. public virtual int IndexOf (string source, char value)
  99. {
  100. if (source == null)
  101. throw new ArgumentNullException ();
  102. return IndexOf (source, value, CompareOptions.None);
  103. }
  104. public virtual int IndexOf (string source, string value)
  105. {
  106. if (source == null)
  107. throw new ArgumentNullException ();
  108. if (value == null)
  109. throw new ArgumentNullException ();
  110. return IndexOf (source, value, CompareOptions.None);
  111. }
  112. [MonoTODO]
  113. public virtual int IndexOf (string source, char value, CompareOptions options)
  114. {
  115. throw new NotImplementedException ();
  116. }
  117. [MonoTODO]
  118. public virtual int IndexOf (string source, char value, int startIndex)
  119. {
  120. if (source == null)
  121. throw new ArgumentNullException ();
  122. if (startIndex < 0 || startIndex > source.Length)
  123. throw new ArgumentOutOfRangeException ();
  124. return IndexOf (source, value, startIndex, CompareOptions.None);
  125. }
  126. [MonoTODO]
  127. public virtual int IndexOf (string source, string value, CompareOptions options)
  128. {
  129. throw new NotImplementedException ();
  130. }
  131. public virtual int IndexOf (string source, string value, int startIndex)
  132. {
  133. if (source == null)
  134. throw new ArgumentNullException ();
  135. if (value == null)
  136. throw new ArgumentNullException ();
  137. if (startIndex < 0 || startIndex > source.Length)
  138. throw new ArgumentOutOfRangeException ();
  139. return IndexOf (source, value, startIndex, CompareOptions.None);
  140. }
  141. [MonoTODO]
  142. public virtual int IndexOf (string source, char value, int startIndex, CompareOptions options)
  143. {
  144. throw new NotImplementedException ();
  145. }
  146. [MonoTODO]
  147. public virtual int IndexOf (string source, char value, int startIndex, int count)
  148. {
  149. if (source == null)
  150. throw new ArgumentNullException ();
  151. if (startIndex < 0 || startIndex > source.Length)
  152. throw new ArgumentOutOfRangeException ();
  153. if (count < 0)
  154. throw new ArgumentOutOfRangeException ();
  155. return IndexOf (source, value, startIndex, count, CompareOptions.None);
  156. }
  157. public virtual int IndexOf (string source, string value, int startIndex, CompareOptions options)
  158. {
  159. throw new NotImplementedException ();
  160. }
  161. public virtual int IndexOf (string source, string value, int startIndex, int count)
  162. {
  163. if (source == null)
  164. throw new ArgumentNullException ();
  165. if (value == null)
  166. throw new ArgumentNullException ();
  167. if (startIndex < 0 || startIndex > source.Length)
  168. throw new ArgumentOutOfRangeException ();
  169. if (count < 0)
  170. throw new ArgumentOutOfRangeException ();
  171. return IndexOf (source, value, startIndex, count, CompareOptions.None);
  172. }
  173. [MonoTODO]
  174. public virtual int IndexOf (string source, char value, int startIndex, int count, CompareOptions options)
  175. {
  176. throw new NotImplementedException ();
  177. }
  178. [MonoTODO]
  179. public virtual int IndexOf (string source, string value, int startIndex, int count, CompareOptions options)
  180. {
  181. throw new NotImplementedException ();
  182. }
  183. [MonoTODO]
  184. public virtual bool IsPrefix(string source, string prefix)
  185. {
  186. if(source == null) {
  187. throw new ArgumentNullException("source is null");
  188. }
  189. if(prefix == null) {
  190. throw new ArgumentNullException("prefix is null");
  191. }
  192. throw new NotImplementedException ();
  193. }
  194. [MonoTODO]
  195. public virtual bool IsPrefix(string source, string prefix, CompareOptions options)
  196. {
  197. if(source == null) {
  198. throw new ArgumentNullException("source is null");
  199. }
  200. if(prefix == null) {
  201. throw new ArgumentNullException("prefix is null");
  202. }
  203. throw new NotImplementedException ();
  204. }
  205. [MonoTODO]
  206. public virtual bool IsSuffix(string source, string suffix)
  207. {
  208. if(source == null) {
  209. throw new ArgumentNullException("source is null");
  210. }
  211. if(suffix == null) {
  212. throw new ArgumentNullException("suffix is null");
  213. }
  214. throw new NotImplementedException ();
  215. }
  216. [MonoTODO]
  217. public virtual bool IsSuffix(string source, string suffix, CompareOptions options)
  218. {
  219. if(source == null) {
  220. throw new ArgumentNullException("source is null");
  221. }
  222. if(suffix == null) {
  223. throw new ArgumentNullException("suffix is null");
  224. }
  225. throw new NotImplementedException ();
  226. }
  227. [MonoTODO]
  228. public virtual int LastIndexOf(string source, char value)
  229. {
  230. if(source == null) {
  231. throw new ArgumentNullException("source is null");
  232. }
  233. throw new NotImplementedException ();
  234. }
  235. [MonoTODO]
  236. public virtual int LastIndexOf(string source, string value)
  237. {
  238. if(source == null) {
  239. throw new ArgumentNullException("source is null");
  240. }
  241. if(value == null) {
  242. throw new ArgumentNullException("value is null");
  243. }
  244. throw new NotImplementedException ();
  245. }
  246. [MonoTODO]
  247. public virtual int LastIndexOf(string source, char value,
  248. CompareOptions options)
  249. {
  250. if(source == null) {
  251. throw new ArgumentNullException("source is null");
  252. }
  253. throw new NotImplementedException ();
  254. }
  255. [MonoTODO]
  256. public virtual int LastIndexOf(string source, char value,
  257. int startIndex)
  258. {
  259. if(source == null) {
  260. throw new ArgumentNullException("source is null");
  261. }
  262. throw new NotImplementedException ();
  263. }
  264. [MonoTODO]
  265. public virtual int LastIndexOf(string source, string value,
  266. CompareOptions options)
  267. {
  268. if(source == null) {
  269. throw new ArgumentNullException("source is null");
  270. }
  271. if(value == null) {
  272. throw new ArgumentNullException("value is null");
  273. }
  274. throw new NotImplementedException ();
  275. }
  276. [MonoTODO]
  277. public virtual int LastIndexOf(string source, string value,
  278. int startIndex)
  279. {
  280. if(source == null) {
  281. throw new ArgumentNullException("source is null");
  282. }
  283. if(value == null) {
  284. throw new ArgumentNullException("value is null");
  285. }
  286. throw new NotImplementedException ();
  287. }
  288. [MonoTODO]
  289. public virtual int LastIndexOf(string source, char value,
  290. int startIndex,
  291. CompareOptions options)
  292. {
  293. if(source == null) {
  294. throw new ArgumentNullException("source is null");
  295. }
  296. throw new NotImplementedException ();
  297. }
  298. [MonoTODO]
  299. public virtual int LastIndexOf(string source, char value,
  300. int startIndex, int count)
  301. {
  302. if(source == null) {
  303. throw new ArgumentNullException("source is null");
  304. }
  305. if(count < 0) {
  306. throw new ArgumentOutOfRangeException("count is less than zero");
  307. }
  308. throw new NotImplementedException ();
  309. }
  310. [MonoTODO]
  311. public virtual int LastIndexOf(string source, string value,
  312. int startIndex,
  313. CompareOptions options)
  314. {
  315. if(source == null) {
  316. throw new ArgumentNullException("source is null");
  317. }
  318. if(value == null) {
  319. throw new ArgumentNullException("value is null");
  320. }
  321. throw new NotImplementedException ();
  322. }
  323. [MonoTODO]
  324. public virtual int LastIndexOf(string source, string value,
  325. int startIndex, int count)
  326. {
  327. if(source == null) {
  328. throw new ArgumentNullException("source is null");
  329. }
  330. if(value == null) {
  331. throw new ArgumentNullException("value is null");
  332. }
  333. if(count < 0) {
  334. throw new ArgumentOutOfRangeException("count is less than zero");
  335. }
  336. throw new NotImplementedException ();
  337. }
  338. [MonoTODO]
  339. public virtual int LastIndexOf(string source, char value,
  340. int startIndex, int count,
  341. CompareOptions options)
  342. {
  343. if(source == null) {
  344. throw new ArgumentNullException("source is null");
  345. }
  346. if(count < 0) {
  347. throw new ArgumentOutOfRangeException("count is less than zero");
  348. }
  349. throw new NotImplementedException ();
  350. }
  351. [MonoTODO]
  352. public virtual int LastIndexOf(string source, string value,
  353. int startIndex, int count,
  354. CompareOptions options)
  355. {
  356. if(source == null) {
  357. throw new ArgumentNullException("source is null");
  358. }
  359. if(value == null) {
  360. throw new ArgumentNullException("value is null");
  361. }
  362. if(count < 0) {
  363. throw new ArgumentOutOfRangeException("count is less than zero");
  364. }
  365. throw new NotImplementedException ();
  366. }
  367. [MonoTODO]
  368. public override string ToString()
  369. {
  370. throw new NotImplementedException ();
  371. }
  372. [MonoTODO]
  373. void IDeserializationCallback.OnDeserialization(object sender)
  374. {
  375. throw new NotImplementedException ();
  376. }
  377. /* LAMESPEC: not mentioned in the spec, but corcompare
  378. * shows it. Some documentation about what it does
  379. * would be nice.
  380. */
  381. [MonoTODO]
  382. public Int32 LCID
  383. {
  384. get {
  385. throw new NotImplementedException();
  386. }
  387. }
  388. }
  389. }