#include "rcc_wrap.h"
#include "rcc.h"
#include <QFile>


bool makeRcc(QString name, QString in_path, QString out_path) {
	qSetGlobalQHashSeed(0);
	if (qGlobalQHashSeed() != 0)
		qWarning("Cannot force QHash seed");
	RCCResourceLibrary library(2);
	QFile errorDevice, temp, out;
	out.setFileName(out_path);
	if (!out.open(QIODevice::WriteOnly))
		return false;
	library.setInitName(name);
	library.setFormat(RCCResourceLibrary::Binary);
	library.setInputFiles(QStringList() << in_path);
	if (!library.readFiles(false, errorDevice))
		return false;
	return library.output(out, temp, errorDevice);
}
