bool Expert::writeConfig(QTextStream &t,bool brief) { if (!brief) { // write global header t << "# Doxyfile " << versionString << endl << endl; // TODO: add version t << "# This file describes the settings to be used by the documentation system\n"; t << "# doxygen (www.doxygen.org) for a project\n"; t << "#\n"; t << "# All text after a hash (#) is considered a comment and will be ignored\n"; t << "# The format is:\n"; t << "# TAG = value [value, ...]\n"; t << "# For lists items can also be appended using:\n"; t << "# TAG += value [value, ...]\n"; t << "# Values that contain spaces should be placed between quotes (\" \")\n"; } QTextCodec *codec = 0; Input *option = m_options[QString::fromAscii("DOXYFILE_ENCODING")]; if (option) { codec = QTextCodec::codecForName(option->value().toString().toAscii()); if (codec==0) // fallback: use UTF-8 { codec = QTextCodec::codecForName("UTF-8"); } } QDomElement childElem = m_rootElement.firstChildElement(); while (!childElem.isNull()) { saveTopic(t,childElem,codec,brief); childElem = childElem.nextSiblingElement(); } return true; }
// the functions below can be used to save // the content of the dabase to the script file. void Eliza::save_data() { scriptfile.open("script.txt", std::ios::out); if(scriptfile.fail()) { throw std::string("Can't save data"); } saveComment(comments[0]); saveTopic(signOn, "S"); saveComment(comments[1]); saveTransposTable(); saveCorrections(); saveComment(comments[2]); saveTopic(nullResponse, "N"); saveComment(comments[3]); saveTopic(subjectRecall, "M"); saveComment(comments[4]); saveTopic(noKeyWord, "X"); saveComment(comments[5]); saveTopic(topicChanger, "Z"); saveComment(comments[6]); saveTopic(inputRepeat, "W"); saveComment(comments[7]); saveKeyWords(); scriptfile.flush(); scriptfile.close(); }
// the functions below can be used to save // the content of the dabase to the script file. void ofxEliza::save( string _scriptFile, string _unknownFile ){ if( m_bNewData ) { scriptfile.open( ofToDataPath(_scriptFile).c_str(), std::ios::out); if(scriptfile.fail()) { throw std::string("Can't save data"); } saveComment(comments[0]); saveTopic(signOn, "S"); saveComment(comments[1]); saveTransposTable(); saveCorrections(); saveComment(comments[2]); saveTopic(nullResponse, "N"); saveComment(comments[3]); saveTopic(subjectRecall, "M"); saveComment(comments[4]); saveTopic(noKeyWord, "X"); saveComment(comments[5]); saveTopic(topicChanger, "Z"); saveComment(comments[6]); saveTopic(inputRepeat, "W"); saveComment(comments[7]); saveKeyWords(); scriptfile.flush(); scriptfile.close(); } saveUnknownSentences(_unknownFile); }
void Eliza::saveComment(const std::string comment) { vstring vComment; vComment.push_back(comment); saveTopic(vComment, ""); }