资源简介
基于c++的matlab解析器,可以解析html,转换成网页的模式。
代码片段和文件信息
/*
* FACTORY.CPP
* Created on: 2017.5.5
* Author: RYAN
*/
#include
#include
#include “Markdown.h“
using namespace std;
void Markdown::operation() {//对文件的操作
string Line;//一行的字符串
bool judge = false;
std::getline(inLine);//从文件中读取一行到 line 中
while (!in.eof())
{
//无序序列 *
judge = Unordered_sequence(Line);
if (judge == true) {
continue;
}
//引用 >
if (judge == false) {
judge = Quotes(Line);
if (judge == true) {
continue;
}
}
//代码块 ‘‘‘
if (judge == false) {
judge = Code_block(Line);
if (judge == true) {
std::getline(inLine);
continue;
}
}
//判断空行
judge = Blank_line(Line);
if (judge == true) {
std::getline(inLine);
continue;
}
//分割线 ---
judge = Dividing_line(Line);
if (judge == true) {
std::getline(inLine);
continue;
}
//标记 ‘~~~~~~‘
judge = code(Line);
if (judge == true) {
out << “\n“ << Line << “
“ <<“\n“;
std::getline(inLine);
continue;
}
//加粗 **~~~~**
Bold(Line);
//斜体 *~~~~~*
Italic(Line);
//图片
Img(Line);
//连接
links(Line);
//判断 # 大标题
judge = Count_Headline(Line);
if (judge == true) {
std::getline(inLine);
continue;
}
out << “\n“ << Line << “
“ <<“\n“;
std::getline(inLine);
}
out << “