X-Git-Url: https://harishankar.org/repos/?p=biaweb2.git;a=blobdiff_plain;f=biawebdoclist.hpp;fp=biawebdoclist.hpp;h=8995c3c09f0d30c865beff327f5fe2151391410e;hp=5922303d15a6a6d325c4a4ad197dde141c1afdce;hb=bfdbd4a6df9232fb6b7f7754903584167b620fe4;hpb=4f787d18286fb9a4c5a36d802860c42c9f862854 diff --git a/biawebdoclist.hpp b/biawebdoclist.hpp index 5922303..8995c3c 100644 --- a/biawebdoclist.hpp +++ b/biawebdoclist.hpp @@ -24,50 +24,33 @@ namespace biaweb { std::time_t ctime; std::time_t mtime; public: - DocListItem (std::string title, std::string url, - std::time_t ctime, std::time_t mtime, std::string desc ) { - this->title = escape_html (title); - this->url = url; - this->ctime = ctime; - this->mtime = mtime; - this->desc = desc; + DocListItem (Document *doc, std::string urlpath) { + this->title = doc->get_title (); + this->url = urlpath + doc->get_filename() + ".html"; + this->ctime = doc->get_creation_date (); + this->mtime = doc->get_modified_date (); + this->desc = doc->get_meta_desc (); } std::string get_desc () { return this->desc; } - void set_desc (std::string desc) { - this->desc = escape_html (desc); - } - std::time_t get_mtime() { return this->mtime; } - void set_mtime(std::time_t mtime) { - this->mtime = mtime; - } + std::time_t get_ctime() { return this->ctime; } - void set_ctime(std::time_t ctime) { - this->ctime = ctime; - } std::string get_url() { return this->url; } - void set_url(std::string url) { - this->url = url; - } - std::string get_title() { return this->title; } - void set_title(std::string title) { - this->title = escape_html (title); - } // output to HTML vide the template std::string to_html (Template *t); @@ -96,7 +79,7 @@ namespace biaweb { std::list items; public: void set_title (std::string title) { - this->title = escape_html (title); + this->title = title; } // add a document item void add_document_item (DocListItem docitem) {