61 lines
1.1 KiB
C++
61 lines
1.1 KiB
C++
#pragma once
|
|
#include <QList>
|
|
#include <QFileInfo>
|
|
|
|
#include <ast_gen.h>
|
|
#include <parse_novel.h>
|
|
|
|
class HtmlElement {
|
|
public:
|
|
explicit HtmlElement(const QString &href):href_store(href){}
|
|
virtual ~HtmlElement() = default;
|
|
|
|
virtual QString href() const{return href_store;}
|
|
|
|
private:
|
|
QString href_store;
|
|
};
|
|
|
|
class FragmentPage : public HtmlElement {
|
|
public:
|
|
explicit FragmentPage(const QString &name, const QString &href);
|
|
|
|
QString wholeText() const;
|
|
|
|
};
|
|
|
|
class StoryLinePage {
|
|
|
|
};
|
|
|
|
class HtmlPrint : public example_novel::FragmentOrdersCheck {
|
|
private:
|
|
QHash<QString, QString> node_address;
|
|
|
|
void volume_output();
|
|
void storyline_output();
|
|
/**
|
|
* 输出情节片段汇总.
|
|
*
|
|
* \param root 内存模型根节点
|
|
* \param frags_o 目标目录
|
|
*/
|
|
void fragment_summary(std::shared_ptr<const ast_gen::ElementAccess> root, const QDir& frags_o);
|
|
|
|
public:
|
|
/**
|
|
* 输出小说内存结构。
|
|
* index.html
|
|
* |——volumns
|
|
* | \——vol_xxx.html
|
|
* |——storyline
|
|
* | \——story_xxx.html
|
|
* \——fragments
|
|
* \——frag_xxxx.html
|
|
* \param out_directory 输出目标目录
|
|
*/
|
|
void htmlOutput(std::shared_ptr<const ast_gen::ElementAccess> novel, const QDir &out_directory) const;
|
|
|
|
};
|
|
|