// if iType == 0 - header file, == 1 - source // file int CContainerBase :: OpenSourceFile(int iType) { m_sFileName = pTargetDirectory; if (iType == 0) m_sFileName += "/include/"; else m_sFileName += "/"; m_sFileName += m_sBlockName; if (iType == 0) m_sFileName += ".h"; else m_sFileName += ".cpp"; vsGeneratedFiles.push_back(m_sFileName); CurrentOutput.open(m_sFileName.c_str()); WriteComment(); if (iType == 0) WriteHeaderStart(); else { if (m_sBlockName == sProjectName) CurrentOutput << "#define __CPP_INIT__\n"; WriteSourceStart(); } return 1; }
void HTMLWriter::WriteHeader(const std::string& title, const std::string& description, const std::string& keywords, const std::string& stylesheetLocation) { try { WriteHeaderStart(title, description, keywords, stylesheetLocation); WriteHeaderEnd(); } catch (std::ifstream::failure& e) { throw IOException(filename,"Cannot write header",e); } catch (std::exception& e) { throw IOException(filename,"Cannot write header",e); } }