<commit_before>#ifndef NEWSBOAT_URLREADER_H_
#define NEWSBOAT_URLREADER_H_

#include <map>
#include <set>
#include <string>
#include <vector>

namespace newsboat {

class UrlReader {
public:
	UrlReader() = default;
	virtual ~UrlReader() = default;
	virtual void write_config() = 0;
	virtual void reload() = 0;
	virtual std::string get_source() = 0;
	std::vector<std::string>& get_urls();
	std::vector<std::string>& get_tags(const std::string& url);
	std::vector<std::string> get_alltags();

protected:
	std::vector<std::string> urls;
	std::map<std::string, std::vector<std::string>> tags;
	std::set<std::string> alltags;
};
<commit_msg>Document interface of Urlreader<commit_after>#ifndef NEWSBOAT_URLREADER_H_
#define NEWSBOAT_URLREADER_H_

#include <map>
#include <set>
#include <string>
#include <vector>

namespace newsboat {

/// \brief Base class for classes that supply Newsboat with feed URLs.
class UrlReader {
public:
	UrlReader() = default;
	virtual ~UrlReader() = default;

	/// \brief Write URLs back to the input file.
	///
	/// This method is used after importing feeds from OPML.
	virtual void write_config() = 0;

	/// \brief Re-read the input file.
	///
	/// \note This overwrites the contents of `urls`, `tags`, and `alltags`, so
	/// make sure to save your modifications with `write_config()`.
	virtual void reload() = 0;

	/// \brief User-visible description of where URLs come from.
	///
	/// This can be a path (e.g. ~/.newsboat/urls), a URL (e.g. the value of
	/// `opml-url` setting), or a name of the remote API in use (e.g. "Tiny
	/// Tiny RSS").
	virtual std::string get_source() = 0;

	/// \brief A list of feed URLs.
	std::vector<std::string>& get_urls();

	/// \brief Tags of feed that has url `url`.
	std::vector<std::string>& get_tags(const std::string& url);

	/// \brief List of all extant tags.
	std::vector<std::string> get_alltags();

protected:
	std::vector<std::string> urls;
	std::map<std::string, std::vector<std::string>> tags;
	std::set<std::string> alltags;
};

{'fraction_non_alphanumeric': 0.1585244267198405, 'fraction_numerical': 0.0029910269192422734, 'mean_word_length': 4.380697050938338, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1957715', 'n_tokens_mistral': 709, 'n_tokens_neox': 685, 'n_words': 211}