// class to implement an RSS feed
class RSSFeed {
protected:
+ std::string title;
std::time_t pub_date;
std::list<RSSFeedItem> items;
public:
// 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() {
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 ();