/*! Finalizes the HTML help. This will finish and close the * contents file (index.hhc) and the index file (index.hhk). * \sa initialize() */ void HtmlHelp::finalize() { // end the contents file cts << "</UL>\n"; cts << "</BODY>\n"; cts << "</HTML>\n"; cts.unsetDevice(); cf->close(); delete cf; index->writeFields(kts); // end the index file kts << "</UL>\n"; kts << "</BODY>\n"; kts << "</HTML>\n"; kts.unsetDevice(); kf->close(); delete kf; createProjectFile(); s_languageDict.clear(); }
bool baseProject::create(string path){ addons.clear(); projectDir = ofFilePath::addTrailingSlash(path); projectName = ofFilePath::getFileName(path); bool bDoesDirExist = false; ofDirectory project(ofFilePath::join(projectDir,"src")); // this is a directory, really? if(project.exists()){ bDoesDirExist = true; }else{ ofDirectory project(projectDir); ofFile::copyFromTo(ofFilePath::join(templatePath,"src"),ofFilePath::join(projectDir,"src")); ofFile::copyFromTo(ofFilePath::join(templatePath,"bin"),ofFilePath::join(projectDir,"bin")); } // if overwrite then ask for permission... bool ret = createProjectFile(); if(!ret) return false; ret = loadProjectFile(); if(!ret) return false; if (bDoesDirExist){ vector < string > fileNames; getFilesRecursively(ofFilePath::join(projectDir , "src"), fileNames); for (int i = 0; i < (int)fileNames.size(); i++){ fileNames[i].erase(fileNames[i].begin(), fileNames[i].begin() + projectDir.length()); string first, last; #ifdef TARGET_WIN32 splitFromLast(fileNames[i], "\\", first, last); #else splitFromLast(fileNames[i], "/", first, last); #endif if (fileNames[i] != "src/ofApp.cpp" && fileNames[i] != "src/ofApp.h" && fileNames[i] != "src/main.cpp" && fileNames[i] != "src/ofApp.mm" && fileNames[i] != "src/main.mm"){ addSrc(fileNames[i], first); } } // if( target == "ios" ){ // getFilesRecursively(ofFilePath::join(projectDir , "bin/data"), fileNames); // // for (int i = 0; i < (int)fileNames.size(); i++){ // fileNames[i].erase(fileNames[i].begin(), fileNames[i].begin() + projectDir.length()); // // string first, last; // splitFromLast(fileNames[i], "/", first, last); // if (fileNames[i] != "Default.png" && // fileNames[i] != "src/ofApp.h" && // fileNames[i] != "src/main.cpp" && // fileNames[i] != "src/ofApp.mm" && // fileNames[i] != "src/main.mm"){ // addSrc(fileNames[i], first); // } // } // } #if defined(TARGET_LINUX) || defined(TARGET_OSX) parseAddons(); #endif // get a unique list of the paths that are needed for the includes. list < string > paths; vector < string > includePaths; for (int i = 0; i < (int)fileNames.size(); i++){ size_t found; #ifdef TARGET_WIN32 found = fileNames[i].find_last_of("\\"); #else found = fileNames[i].find_last_of("/"); #endif paths.push_back(fileNames[i].substr(0,found)); } paths.sort(); paths.unique(); for (list<string>::iterator it=paths.begin(); it!=paths.end(); ++it){ includePaths.push_back(*it); } for (int i = 0; i < includePaths.size(); i++){ addInclude(includePaths[i]); } } return true; }