//--------------------------------------------------------------------------------//
// COPYRIGHT NOTICE //
//--------------------------------------------------------------------------------//
// Copyright (c) 2012, Instituto de Microelectronica de Sevilla (IMSE-CNM) //
// //
// All rights reserved. //
// //
// Redistribution and use in source and binary forms, with or without //
// modification, are permitted provided that the following conditions are met: //
// //
// * Redistributions of source code must retain the above copyright notice, //
// this list of conditions and the following disclaimer. //
// //
// * Redistributions in binary form must reproduce the above copyright //
// notice, this list of conditions and the following disclaimer in the //
// documentation and/or other materials provided with the distribution. //
// //
// * Neither the name of the IMSE-CNM nor the names of its contributors may //
// be used to endorse or promote products derived from this software //
// without specific prior written permission. //
// //
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" //
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE //
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE //
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL //
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR //
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER //
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, //
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE //
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //
//--------------------------------------------------------------------------------//
package xfuzzy.xfsg;
import java.util.*;
/**
* Clase que genera una cabecera para el fichero .m que se genera
* (similar a xfvhdl/XfvhdlHeadFile.java)
*
* @author Jes�s Izquierdo Tena
*/
public class XfsgHeadFile {
private String dirOut;
private String fileOut;
private String fileIn;
private String so;
private String vmachine;
private String date;
private String user;
private String separator;
private boolean init;
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
// CONSTRUCTOR DE LA CLASE
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
public XfsgHeadFile(String dirO, String fileO, String fileI) {
dirOut = dirO;
fileOut = fileO;
fileIn = fileI;
Date now = new Date();
date = now.toString();
if (init != true) {
try {
so = System.getProperty("os.name", "not specified");
so += " ver. ";
so += System.getProperty("os.version", "not specified");
vmachine = System.getProperty("java.version", "not specified");
user = System.getProperty("user.name", "not specified");
separator = System.getProperty("file.separator", "\\");
} catch (Exception e) {
}
init = true;
}
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
// M�TO_DOS P�BLICOS DE LA CLASE
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/**
* M�todo que crea la cabecera para los ficheros Script
*
* @return Devuelve la cabecera que ser� escrita en el fichero Script
*/
/**
* M�todo que crea la cabecera para los ficheros M
*
* @return Devuelve la cabecera que ser� escrita en los ficheros M
*/
public String getMHead() {
String head = new String();
head = "%\n" + "% Automatically generated by Xfsg\n" + "%\n"
+ "% output:: " + dirOut + separator + fileOut + "\n"
+ "% source:: " + fileIn + "\n" + "% for " + user + ", "
+ date + "\n" + "% in " + so + " with VM " + vmachine + "\n"
+ "%\n";
return head;
}
} // Fin de la clase