// Detect It Easy: detection rule file
// Author: horsicq <horsicq@gmail.com>

meta("tool", "CeQuadrat");

function detect() {
    var sDataPreparer = ISO9660.getDataPreparerIdentifier().toUpperCase();

    if (sDataPreparer.indexOf("CEQUADRAT") !== -1 && sDataPreparer.indexOf("ISO-9660 FORMATTER") !== -1) {
        bDetected = true;

        // Try to extract year/version from copyright notice
        // Format: "COPYRIGHT (C) 1995" or "COPYRIGHT (C) 1995-1998"
        var nIndex = sDataPreparer.indexOf("COPYRIGHT (C)");
        if (nIndex !== -1) {
            var sYearPart = sDataPreparer.substring(nIndex + 14, nIndex + 30).trim(),
                nYearEnd = sYearPart.indexOf(" ");

            if (nYearEnd !== -1) {
                sVersion = sYearPart.substring(0, nYearEnd).trim();
            }
        }
    }

    return result();
}