X-Git-Url: https://harishankar.org/repos/?a=blobdiff_plain;ds=sidebyside;f=biawebdoclist.hpp;h=5922303d15a6a6d325c4a4ad197dde141c1afdce;hb=1d6e80c91ca5a6c4551d89e7a1979490c2505745;hp=8a92cddfbe4453130e2ca3174c96ceab23804f36;hpb=eda0b06c5328e232e12e0535528a528493caa90a;p=biaweb2.git diff --git a/biawebdoclist.hpp b/biawebdoclist.hpp index 8a92cdd..5922303 100644 --- a/biawebdoclist.hpp +++ b/biawebdoclist.hpp @@ -20,15 +20,25 @@ namespace biaweb { // Just the required fields to build the item std::string title; std::string url; + std::string desc; 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::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; + } + + std::string get_desc () { + return this->desc; + } + + void set_desc (std::string desc) { + this->desc = escape_html (desc); } std::time_t get_mtime() { @@ -71,7 +81,8 @@ namespace biaweb { m = *std::localtime (&this->mtime); std::string outputhtml = fmt::format (templstr, fmt::arg("url", this->url), - fmt::arg("doctitle", this->title), + fmt::arg("doctitle", this->title), + fmt::arg("desc", this->desc), fmt::arg("cdate", c), fmt::arg("mdate", m));