File: Example64to32App.java

package info (click to toggle)
auto64fto32f 1.4%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 104 kB
  • sloc: java: 289; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 1,141 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import com.peterabeles.auto64fto32f.ConvertFile32From64;
import com.peterabeles.auto64fto32f.RecursiveConvert;

import java.io.File;

/**
 * Auto generates 32bit code from 64bit code in all files inside it's search path.
 *
 * @author Peter Abeles
 */
public class Example64to32App extends RecursiveConvert {


    public Example64to32App(ConvertFile32From64 converter) {
        super(converter);
    }

    public static void main(String args[] ) {
        // Specify list of directories to recursively search
        String directories[] = new String[]{
                "examples"};

        ConvertFile32From64 converter = new ConvertFile32From64(true);

        // Add your own specialized strings
        converter.replacePattern("MyConstants.EPS", "MyConstants.F_EPS");

        Example64to32App app = new Example64to32App(converter);
        for( String dir : directories ) {
            // this will output the F32 files in the same directory as the input.  if you wish it to go to
            // a different location you need to add another parameter with the output file
            app.process(new File(dir) );
        }
    }
}