Curl return code handling
[dueringa_WikiWalker.git] / src / CurlWikiGrabber.h
blobdc5b8c008b854cb8018b0f3b750aaf6b4bb82f34
1 #ifndef _CURL_WIKI_GRABBER_H
2 #define _CURL_WIKI_GRABBER_H
4 #include <string>
5 #include <curl/curl.h>
6 #include "WalkerException.h"
7 #include "Article.h"
9 //! Class responsible for grabbing the contents / links of an article
10 class CurlWikiGrabber
12 public:
13 /*! Create a new instance.
14 * Might throw an exception, if curl intialization failed
16 CurlWikiGrabber();
18 ~CurlWikiGrabber()
20 curl_global_cleanup();
23 /*! given an URL, return article JSON data
24 * \param url URL of the article
25 * \returns article JSON data
27 std::string grabUrl(std::string url) const;
30 #endif // _CURL_WIKI_GRABBER_H