Package info.ata4.unity.cli.cmd

Source Code of info.ata4.unity.cli.cmd.DumpCmd

/*
** 2014 January 08
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
*/
package info.ata4.unity.cli.cmd;

import com.beust.jcommander.Parameters;
import info.ata4.unity.asset.AssetFile;
import info.ata4.unity.cli.dump.AssetDumper;
import java.io.IOException;

/**
*
* @author Nico Bergemann <barracuda415 at yahoo.de>
*/
@Parameters(
    commandNames = "dump",
    commandDescription = "Dumps object data to console."
)
public class DumpCmd extends AssetCommand {
   
    private boolean dumpStructs = false;
    private boolean dumpToFiles = false;
   
    public boolean isDumpStructs() {
        return dumpStructs;
    }

    public DumpCmd setDumpStructs(boolean structs) {
        this.dumpStructs = structs;
        return this;
    }
   
    public boolean isDumpToFiles() {
        return dumpToFiles;
    }

    public DumpCmd setDumpToFiles(boolean dumpToFiles) {
        this.dumpToFiles = dumpToFiles;
        return this;
    }

    @Override
    public void processAsset(AssetFile asset) throws IOException {
        AssetDumper dmp = new AssetDumper(asset);
        dmp.setClassFilter(getOptions().getClassFilter());
        if (dumpToFiles) {
            dmp.setOutputDir(getOutputDir());
        }
        if (dumpStructs) {
            dmp.dumpStruct();
        } else {
            dmp.dumpData();
        }
    }
}
TOP

Related Classes of info.ata4.unity.cli.cmd.DumpCmd

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.