00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef DOCGENERATOR_H
00025 #define DOCGENERATOR_H
00026
00027 #include <string>
00028 #include <iostream>
00029
00030 #include "doctemplate.h"
00031
00032 using std::string;
00033
00034 namespace srchilite {
00035
00040 class DocGenerator {
00041 protected:
00042 string title;
00043 bool gen_source_highlight_version;
00044 string input_file_name;
00045 string doc_header;
00046 string doc_footer;
00047 string css_url;
00048 string doc_background;
00049 bool entire_doc;
00050
00051 DocTemplate docTemplate;
00052
00053 public:
00054 DocGenerator(const string &s, const string &i, const string &h,
00055 const string &f, const string &c, const string &back, bool entire,
00056 const string &start_tmpl, const string &end_tmpl) :
00057 title(s), gen_source_highlight_version(true), input_file_name(i),
00058 doc_header(h), doc_footer(f), css_url(c), doc_background(back),
00059 entire_doc(entire), docTemplate(DocTemplate(start_tmpl,
00060 end_tmpl)) {
00061 }
00062 DocGenerator(const string &start_tmpl, const string &end_tmpl) :
00063 gen_source_highlight_version(true), docTemplate(DocTemplate(start_tmpl,
00064 end_tmpl)) {
00065 }
00066 DocGenerator() {
00067 }
00068 ~DocGenerator() {
00069 }
00070
00076 void generate_start_doc(std::ostream *sout);
00077
00083 void generate_end_doc(std::ostream *sout);
00084
00088 void set_gen_version(bool b) {
00089 gen_source_highlight_version = b;
00090 }
00091
00092 void setInputFileName(const std::string &filename) {
00093 input_file_name = filename;
00094 }
00095
00096 void setTitle(const std::string &_title) {
00097 title = _title;
00098 }
00099
00100 void setBackgroundColor(const std::string &bg) {
00101 doc_background = bg;
00102 }
00103
00104 void setCss(const std::string &css) {
00105 css_url = css;
00106 }
00107
00108 void setHeader(const std::string &_header) {
00109 doc_header = _header;
00110 }
00111
00112 void setFooter(const std::string &_footer) {
00113 doc_footer = _footer;
00114 }
00115 };
00116
00117 }
00118
00119 #endif // DOCGENERATOR_H