IUasmFile* Project::addFile(QString absoluteFilePath) { //check if allready in list for (int i = 0; i < m_projectUasmFiles.size(); i++) { if (m_projectUasmFiles[i]->getRelativePath() == getProjectDir()->relativeFilePath(absoluteFilePath)) return NULL; } setIsNotSaved(); //file Info QFileInfo newFileInfo(absoluteFilePath); //create empty file if non exsist if (!newFileInfo.exists()) { QFile filePointer(absoluteFilePath); filePointer.open( QIODevice::ReadWrite ); filePointer.flush(); filePointer.close(); } UAsmFile *file = new UAsmFile(this, absoluteFilePath); m_projectUasmFiles.push_back(file); return file; }
int main(int argc, char* argv[]) { FILE *fp = filePointer(argc, argv); if (fp == NULL) return EXIT_FAILURE; solve(fp); fclose(fp); return EXIT_SUCCESS; }