Pogger/src/Feed.h

74 lines
1.2 KiB
C
Raw Normal View History

2020-12-30 22:07:54 -06:00
/*
* Copyright 2020, Jaidyn Levesque <jadedctrl@teknik.io>
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef FEED_H
#define FEED_H
2020-06-19 17:03:19 -05:00
2020-12-30 22:07:54 -06:00
#include <tinyxml2.h>
2020-12-30 22:07:54 -06:00
2020-08-14 01:59:15 -05:00
#include "Entry.h"
2020-06-18 02:02:44 -05:00
2020-12-30 22:07:54 -06:00
class BDateTime;
class BString;
class BList;
class BUrl;
class Feed {
2020-06-18 02:02:44 -05:00
public:
2020-12-30 22:07:54 -06:00
Feed(BString);
Feed();
virtual void Parse();
bool IsRemote();
bool IsUpdated();
bool IsRss();
bool IsAtom();
bool AddEntry(Entry*);
BList GetEntries();
bool SetTitle(const char*);
bool SetTitle(tinyxml2::XMLElement*);
BString GetTitle();
bool SetDesc(const char*);
bool SetDesc(tinyxml2::XMLElement*);
BString GetDesc();
bool SetHomeUrl(const char*);
bool SetHomeUrl(tinyxml2::XMLElement*);
BString GetHomeUrl();
bool SetDate(const char*);
bool SetDate(tinyxml2::XMLElement*);
BDateTime GetDate();
BString SetCachePath(BString);
BString GetCachePath();
protected:
2020-12-30 22:07:54 -06:00
void EnsureCached();
BString FetchRemoteFeed();
int xmlCountSiblings(tinyxml2::XMLElement*, const char*);
BString title;
BString description;
BDateTime date;
BDateTime lastDate;
BDateTime minDate;
BDateTime maxDate;
BString homeUrl;
BString inputPath;
BString xmlUrl;
BString cachePath;
BString outputDir;
BList entries;
bool fetched;
bool updated;
2020-06-18 02:02:44 -05:00
};
2020-12-30 22:07:54 -06:00
2020-06-19 17:03:19 -05:00
#endif
2020-12-30 22:07:54 -06:00