X-Git-Url: https://harishankar.org/repos/?p=biaweb2.git;a=blobdiff_plain;f=biawebrss.hpp;fp=biawebrss.hpp;h=61cee82400dc639dbb1a6e80bbb51100fad0d158;hp=eb4d0aa1f7d2c0de187ea21e03c4456fd56caa6b;hb=293e3ffadbd0c297b5e2291c1f4c7d98625cd991;hpb=e16a6540bdbe09d54677caae65e16598c1da2538 diff --git a/biawebrss.hpp b/biawebrss.hpp index eb4d0aa..61cee82 100644 --- a/biawebrss.hpp +++ b/biawebrss.hpp @@ -69,6 +69,7 @@ namespace biaweb { // class to implement an RSS feed class RSSFeed { protected: + std::string title; std::time_t pub_date; std::list items; public: @@ -80,6 +81,13 @@ namespace biaweb { // number of items std::size_t get_num_items () { return this->items.size (); + } + + std::string get_title () { + return this->title; + } + void set_title (std::string title) { + this->title = escape_html (title); } std::time_t get_pub_date() { @@ -103,7 +111,8 @@ namespace biaweb { std::string output = fmt::format (templ_str, fmt::arg ("pubdate", ct), - fmt::arg ("items", items_str) ); + fmt::arg ("items", items_str), + fmt::arg ("title", this->title)); std::ofstream f (path + "/feed.xml"); f << output; f.close ();