Subversion Repositories display

Rev

Rev 23 | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
 * Copyright (C) 2007 Steve Ratcliffe
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *
 * Author: Steve Ratcliffe
 * Create date: Dec 16, 2007
 */

package test.display;

/**
 * Standalone program to display a MDX file.
 *
 * @author Steve Ratcliffe
 */

public class MdxDisplay extends CommonDisplay {

        protected void print() {
                Displayer d = new Displayer(reader);
                d.setTitle("MDX file");

                d.intValue("id %x");
                d.charValue("version? %d");
                d.intValue("record size %d");
                d.intValue("number of records %d");
                //d.charValue("??? %d");
                //d.charValue("? %d");
                //d.charValue("family? %d");
                //d.charValue("family? %d");
                //d.intValue("??? %d");

                while (reader.position() < filelen) {
                        d.gap();
                        d.intValue("map number hex %x");
                        d.charValue("product %d");
                        d.charValue("family %d");
                        d.intValue("map number %d");
                }
                d.print(outStream);
        }

        public static void main(String[] args) {
                if (args.length < 1) {
                        System.err.println("Usage: mdxdisplay <filename>");
                        System.exit(1);
                }

                CommonDisplay td = new MdxDisplay();
                td.display(args[0]);
        }
}