SyndicationDomination 0.0
An RSS/Atom parser, because there's nothing else out there.
Loading...
Searching...
No Matches
opml_item.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <pugixml.hpp>
5#include <vector>
6#include "utils.hpp"
7
8using namespace pugi;
9
19class OpmlItem {
20private:
21 xml_node item_node;
22 bool essentials_only{false};
23 std::string title;
24 std::string description;
25 std::string url;
26 std::string feed_url;
27
28 std::vector<std::string> categories{};
29 std::vector<std::string> additional_categories{};
30
31 std::string type;
32 std::string language;
33
38 void parse();
39public:
51 xml_node item_node, bool essentials_only=false,
52 std::vector<std::string> additional_categories={}
53 ) : item_node{item_node}, essentials_only{essentials_only},
54 additional_categories{additional_categories} {
55 parse();
56 }
57
62 std::string get_text();
63
64 std::string get_title() { return title; }
65 std::string get_description() { return description; }
66 std::string get_url() { return url; }
67 std::string get_feed_url() { return feed_url; }
68 std::vector<std::string> get_categories() { return categories; }
69 std::string get_type() { return type; }
70 std::string get_language() { return language; }
71
72 std::string to_json();
73};
Represents a single feed extracted from an OPML file.
Definition opml_item.hpp:19
std::string get_title()
Definition opml_item.hpp:64
std::string get_feed_url()
Definition opml_item.hpp:67
std::string to_json()
Definition opml_item.cpp:37
std::string get_description()
Definition opml_item.hpp:65
std::vector< std::string > get_categories()
Definition opml_item.hpp:68
std::string get_url()
Definition opml_item.hpp:66
std::string get_text()
Not applicable for a valid OpmlItem, gets the value of the text attribute in case the current outline...
Definition opml_item.cpp:57
std::string get_language()
Definition opml_item.hpp:70
std::string get_type()
Definition opml_item.hpp:69
OpmlItem(xml_node item_node, bool essentials_only=false, std::vector< std::string > additional_categories={})
Constructs the OpmlItem object from a pugi::xml_node representing an item in an OPML file.
Definition opml_item.hpp:50