*** empty log message ***
[m17n/m17n-lib-cs.git] / chartab.cs
1 using System;
2 using System.Collections.Generic;
3 using System.IO;
4 using M17N;
5 using M17N.Core;
6
7 public class Test
8 {
9   public static void Main()
10   {
11     MCharTable tbl = new MCharTable ();
12
13     tbl[0x100] = MSymbol.Of ("test-100");
14     tbl[0x101] = MSymbol.Of ("test-101");
15     tbl[0xFFF] = MSymbol.Of ("test-FFF");
16     tbl[0x1000] = MSymbol.Of ("test-1000");
17
18     tbl[0x2070, 0x4001] = MSymbol.t;
19
20     Console.WriteLine ("# Direct access by tbl[CHAR]");
21     Console.WriteLine ("0x100:{0}, 0x1000:{1}", tbl[0x100], tbl[0x1000]);
22     Console.WriteLine ("0x206F:{0}, 0x2070:{1}, 0x4001:{2}, 0x4002:{3}",
23                        tbl[0x206F], tbl[0x2070], tbl[0x4001], tbl[0x4002]);
24
25     Console.WriteLine ("# Enumerate on tbl");
26     foreach (MCharRange range in tbl)
27       Console.WriteLine (range);
28
29     Console.WriteLine ("# Using CharRange from U+3000 to U+0");
30     MCharRange r = new MCharRange (0x3000, tbl);
31     do {
32       Console.WriteLine (r);
33     } while (r.Prev ());
34   }
35 }