From 82f471755e60701d6494ff17b03ec5ac28b537e2 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 7 Aug 2019 20:32:46 +0200 Subject: [PATCH] Improved library-documentation. --- include/sqlite.hpp | 37 ++++++++++++++++++++++++----- include/uri.hpp | 59 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 81 insertions(+), 15 deletions(-) diff --git a/include/sqlite.hpp b/include/sqlite.hpp index bd88b32..e91e59a 100644 --- a/include/sqlite.hpp +++ b/include/sqlite.hpp @@ -60,23 +60,48 @@ namespace remwharead string description; string fulltext; - //! Returns true if date and time are equal. + /*! + * @brief Returns true if date and time are equal. + * + * @since 0.6.0 + */ friend bool operator ==(const Database::entry &a, const Database::entry &b); - //! The full text in one line. + + /*! + * @brief The full text in one line. + * + * @since 0.6.0 + */ const string fulltext_oneline() const; } entry; - //! Connects to the database and creates it if necessary. + /*! + * @brief Connects to the database and creates it if necessary. + * + * @since 0.6.0 + */ Database(); - //! Returns true if connected to the database. + /*! + * @brief Returns true if connected to the database. + * + * @since 0.6.0 + */ operator bool() const; - //! Store a Database::entry in the database. + /*! + * @brief Store a Database::entry in the database. + * + * @since 0.6.0 + */ void store(const entry &data) const; - //! Retrieve a vector of Database::entry from the database. + /*! + * @brief Retrieve a vector of Database::entry from the database. + * + * @since 0.6.0 + */ const vector retrieve( const time_point &start = time_point(), const time_point &end = system_clock::now()) const; diff --git a/include/uri.hpp b/include/uri.hpp index ab7f176..1cc13ef 100644 --- a/include/uri.hpp +++ b/include/uri.hpp @@ -71,30 +71,61 @@ namespace remwharead class URI { public: - //! Construct object and set URL. + /*! + * @brief Construct object and set URL. + * + * Initializes TLS and sets proxy from the environment variable + * `http_proxy`, if possible. + * + * @since 0.6.0 + */ explicit URI(const string &uri); virtual ~URI(); - //! Download %URI and extract title, description and full text. + /*! + * @brief Download %URI and extract title, description and full text. + * + * @since 0.6.0 + */ const html_extract get(); - //! Save %URI in archive and return archive-URI. + /*! + * @brief Save %URI in archive and return archive-URI. + * + * @since 0.6.0 + */ const archive_answer archive(); protected: string _uri; - //! Make a HTTP(S) request. + /*! + * @brief Make a HTTP(S) request. + * + * @since 0.6.0 + */ const string make_request(const string &uri, bool archive = false) const; - //! Extract the title from an HTML page. + /*! + * @brief Extract the title from an HTML page. + * + * @since 0.6.0 + */ const string extract_title(const string &html); - //! Extract the description from an HTML page. + /*! + * @brief Extract the description from an HTML page. + * + * @since 0.6.0 + */ const string extract_description(const string &html); - //! 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 + */ const string strip_html(const string &html); /*! @@ -102,14 +133,24 @@ namespace remwharead * * @param html HTML page. * @param tag If set, only remove this tag. + * + * @since 0.6.0 */ const string remove_html_tags(const string &html, const string &tag = ""); - //! Convert HTML entities to UTF-8. + /*! + * @brief Convert HTML entities to UTF-8. + * + * @since 0.6.0 + */ const string unescape_html(const string &html); - //! Replace newlines with spaces. + /*! + * @brief Replace newlines with spaces. + * + * @since 0.6.0 + */ const string remove_newlines(string text); }; }