Add validation to the new project wizard

This commit is contained in:
2017-04-20 18:35:14 -05:00
parent 681eb55db3
commit 9730ef773e
6 changed files with 237 additions and 63 deletions
+33
View File
@@ -0,0 +1,33 @@
/*
* Copyright 2016-2017 gtalent2@gmail.com
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <QByteArray>
#include <QDir>
#include <ox/fs/filesystem.hpp>
#include <project.hpp>
namespace nostalgia {
namespace studio {
using namespace ox::fs;
void Project::create(QString path) {
QDir().mkpath(path);
size_t buffLen = 1024;
m_romBuff = new QByteArray(buffLen, 0);
FileSystem32::format(m_romBuff->data(), buffLen, true);
QFile file(path + "/ROM.oxfs");
file.open(QIODevice::WriteOnly);
file.write(*m_romBuff);
file.close();
}
}
}