00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 2006-2008 Peter Miller 00004 // Copyright (C) 2005 Matthew Lee; 00005 // 00006 // This program is free software; you can redistribute it and/or modify 00007 // it under the terms of the GNU General Public License as published by 00008 // the Free Software Foundation; either version 3 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // This program is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with this program. If not, see 00018 // <http://www.gnu.org/licenses/>. 00019 // 00020 00021 #ifndef LIBAEGIS_RSS_FEED_H 00022 #define LIBAEGIS_RSS_FEED_H 00023 00024 #include <common/nstring.h> 00025 00026 // Forward declarations 00027 class rss_item; 00028 struct project_ty; 00029 00036 class rss_feed 00037 { 00038 public: 00042 virtual ~rss_feed(); 00043 00054 rss_feed(project_ty *the_project, change::pointer the_change, 00055 const nstring &the_file); 00056 00063 void push_back(rss_item *the_item); 00064 00068 rss_item *back() const; 00069 rss_item *pop_back(); 00070 00077 void parse(); 00078 00083 void print() const; 00084 00092 void print(output::pointer op) const; 00093 00094 void handle_item(); 00095 void handle_item_title(const nstring &value); 00096 void handle_item_description(const nstring &value); 00097 void handle_item_pub_date(const nstring &value); 00098 void handle_item_link(const nstring &value); 00099 void handle_item_author(const nstring &value); 00100 void handle_item_category(const nstring &value); 00101 void handle_item_comments(const nstring &value); 00102 void handle_item_enclosure(const nstring &value); 00103 void handle_item_guid(const nstring &value, bool attr); 00104 void handle_item_source(const nstring &value); 00105 00106 size_t size() const { return item_count; } 00107 00112 void channel_elements_from_project(); 00113 00119 void channel_elements_from_change(); 00120 00121 void title_set(const nstring &rg); 00122 void description_set(const nstring &rg); 00123 00124 private: 00128 project_ty *project; 00129 00133 change::pointer cp; 00134 00138 nstring filename; 00139 00147 nstring title; 00148 00153 nstring description; 00154 00159 nstring language; 00160 00168 nstring pub_date; 00169 00174 nstring last_build_date; 00175 00180 nstring generator; 00181 00189 nstring docs; 00190 00195 nstring link; 00196 00197 rss_item **item; 00198 size_t item_count; 00199 size_t item_max; 00200 00204 rss_feed(); 00205 00209 rss_feed(const rss_feed &arg); 00210 00214 rss_feed &operator=(const rss_feed &arg); 00215 }; 00216 00217 #endif // LIBAEGIS_RSS_FEED_H