📄 makehtml.cpp
字号:
#include "stdafx.h"
#include <fstream.h>
#include <iostream.h>
#include "makehtml.h"
ofstream of;
bool CreateHTML(LPCTSTR lpscFileName, LPCTSTR lpscTitle)
{
of.open(lpscFileName, ios::out);
of <<"<html>\n\n"
<<"<head>\n"
<<"\t<title>"<<lpscTitle<<"</title>\n"
<<"</head>\n\n"
<<"<body>\n\n";
return true;
}
bool FinishHTML()
{
of <<"\n</body>\n"
<<"</html>\n";
of.close();
return true;
}
void AddHTMLLine(LPCTSTR lpscLine, int nIndent)
{
for (int i=0; i<nIndent; i++)
of << "\t";
of << lpscLine << "\n";
}
void InsertHTMLHeader(LPCTSTR lpscData)
{
of <<"<h1>"<<lpscData<<"</h1>\n";
}
CString CreateHTMLImageString(LPCTSTR lpscData)
{
CString str("<img src=\"");
str += lpscData;
str +="\">";
return str;
}
void InsertHTMLHLine()
{
of << "\n<hr>\n\n";
}
void CreateHTMLTable(LPCTSTR lpscData)
{
of << "<table " << lpscData << ">\n";
}
void FinishHTMLTable()
{
of << "</table>\n";
}
void CreateHTMLRow()
{
of << "\t<tr>\n";
}
void FinishHTMLRow()
{
of << "\t</tr>\n";
}
void InsertHTMLCell(LPCTSTR lpscParam, LPCTSTR lpscData)
{
of << "\t\t<td " << lpscParam << ">" << lpscData << "</td>\n";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -