Reformat uri.hpp.

This commit is contained in:
tastytea 2020-10-31 13:25:45 +01:00
parent b7d5b21899
commit 5b82bb0ef0
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 17 additions and 27 deletions

View File

@ -22,8 +22,8 @@
namespace remwharead namespace remwharead
{ {
using std::uint16_t;
using std::string; using std::string;
using std::uint16_t;
/*! /*!
* @brief A processed HTML page. * @brief A processed HTML page.
@ -94,16 +94,14 @@ public:
* *
* @since 0.6.0 * @since 0.6.0
*/ */
[[nodiscard]] [[nodiscard]] html_extract get();
html_extract get();
/*! /*!
* @brief Save %URI in archive and return archive-URI. * @brief Save %URI in archive and return archive-URI.
* *
* @since 0.6.0 * @since 0.6.0
*/ */
[[nodiscard]] [[nodiscard]] archive_answer archive() const;
archive_answer archive() const;
protected: protected:
string _uri; string _uri;
@ -115,32 +113,29 @@ protected:
* *
* @since 0.6.0 * @since 0.6.0
*/ */
[[nodiscard]] [[nodiscard]] string make_request(const string &uri,
string make_request(const string &uri, bool archive = false) const; bool archive = false) const;
/*! /*!
* @brief Extract the title from an HTML page. * @brief Extract the title from an HTML page.
* *
* @since 0.6.0 * @since 0.6.0
*/ */
[[nodiscard]] [[nodiscard]] string extract_title() const;
string extract_title() const;
/*! /*!
* @brief Extract the description from an HTML page. * @brief Extract the description from an HTML page.
* *
* @since 0.6.0 * @since 0.6.0
*/ */
[[nodiscard]] [[nodiscard]] string extract_description() const;
string extract_description() const;
/*! /*!
* @brief Removes HTML tags and superflous spaces from an HTML page. * @brief Removes HTML tags and superflous spaces from an HTML page.
* *
* @since 0.6.0 * @since 0.6.0
*/ */
[[nodiscard]] [[nodiscard]] string strip_html() const;
string strip_html() const;
/*! /*!
* @brief Remove HTML tags. * @brief Remove HTML tags.
@ -150,24 +145,22 @@ protected:
* *
* @since 0.6.0 * @since 0.6.0
*/ */
[[nodiscard]] [[nodiscard]] static string remove_html_tags(const string &html,
static string remove_html_tags(const string &html, const string &tag = ""); const string &tag = "");
/*! /*!
* @brief Convert HTML entities to UTF-8. * @brief Convert HTML entities to UTF-8.
* *
* @since 0.6.0 * @since 0.6.0
*/ */
[[nodiscard]] [[nodiscard]] static string unescape_html(string html);
static string unescape_html(string html);
/*! /*!
* @brief Replace newlines with spaces. * @brief Replace newlines with spaces.
* *
* @since 0.6.0 * @since 0.6.0
*/ */
[[nodiscard]] [[nodiscard]] static string remove_newlines(string text);
static string remove_newlines(string text);
/*! /*!
* @brief Set proxy server. * @brief Set proxy server.
@ -181,16 +174,14 @@ protected:
* *
* @since 0.8.5 * @since 0.8.5
*/ */
[[nodiscard]] [[nodiscard]] static string cut_text(const string &text, uint16_t n_chars);
static string cut_text(const string &text, uint16_t n_chars);
/*! /*!
* @brief Converts string to UTF-8. * @brief Converts string to UTF-8.
* *
* @since 0.9.2 * @since 0.9.2
*/ */
[[nodiscard]] [[nodiscard]] inline string to_utf8(const string &str);
inline string to_utf8(const string &str);
/*! /*!
* @brief Try to detect the encoding of the document. * @brief Try to detect the encoding of the document.
@ -204,9 +195,8 @@ protected:
* *
* @since 0.9.2 * @since 0.9.2
*/ */
[[nodiscard]] [[nodiscard]] bool is_html() const;
bool is_html() const;
}; };
} // namespace remwharead } // namespace remwharead
#endif // REMWHAREAD_URI_HPP #endif // REMWHAREAD_URI_HPP