SyndicationDomination 0.0
An RSS/Atom parser, because there's nothing else out there.
Loading...
Searching...
No Matches
opml.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5#include <pugixml.hpp>
6#include "opml_item.hpp"
7#include "utils.hpp"
8
9using namespace pugi;
10
19class Opml {
20private:
21 xml_document doc;
22 xml_node body;
23
24 std::string path;
25 bool essentials_only{false};
26 std::vector<OpmlItem> items;
27
31 bool verify();
32
37 void parse();
38
39 void parse_node_children(
40 xml_node node,
41 std::vector<std::string> additional_categories={}
42 );
43
44public:
45
58 std::string path, bool essentials_only=false
59 ) : path{path}, essentials_only{essentials_only} {
60 parse();
61 }
62
66 std::vector<OpmlItem> get_items() { return items; }
67
71 std::string to_json();
72};
Represents a collection of feeds, typically exported from a feed reader.
Definition opml.hpp:19
Opml(std::string path, bool essentials_only=false)
Constructs the Opml object from a valid OPML file path.
Definition opml.hpp:57
std::string to_json()
Represents the Opml object (itself) as a json, returned as a string.
Definition opml.cpp:56
std::vector< OpmlItem > get_items()
Retrieve the OpmlItem objects that have been parsed.
Definition opml.hpp:66