66 lines
1.8 KiB
C++
66 lines
1.8 KiB
C++
/* This file is part of FediBlock-backend.
|
|
* Copyright © 2020 tastytea <tastytea@tastytea.de>
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
* the Free Software Foundation, version 3.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef FEDIBLOCK_BACKEND_RSS_HPP
|
|
#define FEDIBLOCK_BACKEND_RSS_HPP
|
|
|
|
#include "types.hpp"
|
|
|
|
#include <cstdint>
|
|
#include <ostream>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
namespace FediBlock::rss
|
|
{
|
|
|
|
using std::ostream;
|
|
using std::string;
|
|
using std::string_view;
|
|
using std::uint8_t;
|
|
using std::vector;
|
|
|
|
/*!
|
|
* @brief Write a line of RSS.
|
|
*
|
|
* @param out The ostream to use for output.
|
|
* @param spaces Preceding spaces.
|
|
* @param rsstag RSS tag.
|
|
* @param value Content of the tag.
|
|
*
|
|
* @since 0.2.0
|
|
*/
|
|
void write_line(ostream &out, uint8_t spaces, string_view rsstag,
|
|
string_view value);
|
|
|
|
/*!
|
|
* @brief Convert entries to RSS.
|
|
*
|
|
* @param out The ostream to use for output.
|
|
* @param entries The entries to write.
|
|
* @param tags Only write entries with these tags (logical or). An empty
|
|
* vector selects all tags.
|
|
*
|
|
* @since 0.2.0
|
|
*/
|
|
void write_rss(ostream &out, const vector<entry_type> &entries,
|
|
const vector<string> &tags);
|
|
|
|
} // namespace FediBlock::rss
|
|
|
|
#endif // FEDIBLOCK_BACKEND_RSS_HPP
|