2020-07-08 03:20:03 -05:00
|
|
|
#ifndef FEED_H
|
|
|
|
#define FEED_H
|
2020-06-19 17:03:19 -05:00
|
|
|
|
2020-07-04 04:44:54 -05:00
|
|
|
#include <tinyxml2.h>
|
2020-06-18 02:02:44 -05:00
|
|
|
#include <DateTime.h>
|
|
|
|
#include <String.h>
|
|
|
|
#include <List.h>
|
|
|
|
#include <Url.h>
|
2020-07-03 19:13:41 -05:00
|
|
|
#include "Config.h"
|
2020-06-18 02:02:44 -05:00
|
|
|
|
2020-07-08 03:20:03 -05:00
|
|
|
class Feed {
|
2020-06-18 02:02:44 -05:00
|
|
|
public:
|
2020-07-13 12:31:52 -05:00
|
|
|
Feed ( BString, Config* );
|
2020-07-08 04:43:35 -05:00
|
|
|
Feed ( );
|
|
|
|
|
2020-06-18 02:02:44 -05:00
|
|
|
BString title;
|
|
|
|
BString description;
|
2020-07-08 03:20:03 -05:00
|
|
|
BDateTime date;
|
|
|
|
BString homeUrl;
|
2020-06-18 02:02:44 -05:00
|
|
|
BString xmlUrl;
|
|
|
|
BString filePath;
|
2020-06-20 21:15:34 -05:00
|
|
|
BString outputDir;
|
2020-07-08 04:43:35 -05:00
|
|
|
BList entries;
|
2020-07-08 03:20:03 -05:00
|
|
|
|
2020-07-03 19:13:41 -05:00
|
|
|
void Parse ( Config* );
|
2020-07-04 04:44:54 -05:00
|
|
|
|
2020-07-04 10:27:38 -05:00
|
|
|
bool SetTitle ( const char* );
|
|
|
|
bool SetTitle ( tinyxml2::XMLElement* );
|
|
|
|
bool SetDesc ( const char* );
|
|
|
|
bool SetDesc ( tinyxml2::XMLElement* );
|
2020-07-08 03:20:03 -05:00
|
|
|
bool SetDate ( const char* );
|
|
|
|
bool SetDate ( tinyxml2::XMLElement* );
|
|
|
|
bool SetHomeUrl ( const char* );
|
|
|
|
bool SetHomeUrl ( tinyxml2::XMLElement* );
|
2020-07-08 04:43:35 -05:00
|
|
|
|
|
|
|
bool IsRss ( );
|
|
|
|
bool IsAtom ( );
|
|
|
|
|
|
|
|
protected:
|
2020-07-13 12:31:52 -05:00
|
|
|
BString GetCachePath ( BString, Config* );
|
|
|
|
int xmlCountSiblings ( tinyxml2::XMLElement*, const char* );
|
2020-06-18 02:02:44 -05:00
|
|
|
};
|
|
|
|
|
2020-06-19 17:03:19 -05:00
|
|
|
#endif
|