Code

new files
[inkscape.git] / src / dom / Filt.java
3 import java.io.*;
5 public class Filt
6 {
8 void p(String s)
9 {
10     System.out.println(s);
11 }
13 void output(String s)
14 {
15     String name = s.trim();
16     if (name == null || name.length()<2)
17         return;
18     String ucName = name.substring(0,1).toUpperCase() +
19                     name.substring(1);
20         
21     p("/**");
22     p(" *  return the '" + name + "' property" );
23     p(" */");
24     p("DOMString CSS2PropertiesImpl::get" + ucName + "()");
25     p("{");
26     p("    return " + name + ";");
27     p("}");
28     p("");
29     p("/**");
30     p(" *  set the '" + name + "' property");
31     p(" */");
32     p("void CSS2PropertiesImpl::set" + ucName + "(const DOMString &val)");
33     p("                         throw (dom::DOMException)");
34     p("{");
35     p("    " + name + " = val;");
36     p("}");
37     p("");
40 }
43 void doIt()
44 {
45     try
46         {
47         BufferedReader in = new BufferedReader(new FileReader("cssprop.txt"));
48     
49         while (true)
50             {
51             String s = in.readLine();
52             if (s == null)
53                 break;
54             output(s);
55             }
56         
57         in.close();
58         }
59     catch (Exception e)
60         {
61         }
63 }
67 public static void main(String argv[])
68 {
69     Filt f = new Filt();
70     f.doIt();
72 }
76 }