Add conversion for backwards links
[dueringa_WikiWalker.git] / inc / CurlWikiGrabber.h
blob609f341dcf5abbfea9a795c5e1b8bf344993ef06
1 //! \file CurlWikiGrabber.h
3 #ifndef WIKIWALKER_CURL_WIKI_GRABBER_H
4 #define WIKIWALKER_CURL_WIKI_GRABBER_H
6 #include <string>
8 namespace WikiWalker
10 //! Class responsible for grabbing the contents / links of an article
11 class CurlWikiGrabber
13 public:
14 /*! Create a new instance.
15 * Might throw an exception, if curl intialization failed
17 CurlWikiGrabber();
19 ~CurlWikiGrabber();
21 //! Explicitely delete copy constructor, because curl handle
22 CurlWikiGrabber(const CurlWikiGrabber& other) = delete;
23 //! Explicitely delete move constructor, because curl handle
24 CurlWikiGrabber(CurlWikiGrabber&& other) = delete;
26 //! Explicitely delete copy assignment operator, because curl handle
27 CurlWikiGrabber& operator=(const CurlWikiGrabber& other) = delete;
28 //! Explicitely delete move assignment operator, because curl handle
29 CurlWikiGrabber& operator=(CurlWikiGrabber&& other) = delete;
31 /*! given an URL, return article JSON data
32 * \param url URL of the article
33 * \returns article JSON data
35 std::string grabUrl(const std::string& url) const;
37 /*! Set whether to skip SSL verification.
38 * \param state whether to skip SSL verification
39 * this was added because vcpkg's libcurl doesn't have
40 * a default CA certificate lookup path.
42 void skipSslVerification(bool state);
44 private:
45 bool skipSslVerificationState_{false};
47 } // namespace WikiWalker
48 #endif // WIKIWALKER_CURL_WIKI_GRABBER_H