Skip to content

Commit

Permalink
web/libcurl_wrapper.cc: Add minor code changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
siko1056 committed Jan 3, 2018
1 parent 87fded0 commit 3b6eca0
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions web/libcurl_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ along with Octave; see the file COPYING. If not, see
*/

//#if defined (HAVE_CURL)
# include <curl/curl.h>
# include <curl/curlver.h>
# include <curl/easy.h>
#include <curl/curl.h>
#include <curl/curlver.h>
#include <curl/easy.h>
//#endif

#include <octave/oct.h>

//! Wrapper class for libcurl's easy interface, for the API specification see
//! https://curl.haxx.se/libcurl/c/libcurl-easy.html.

class libcurl_wrapper {
private:
CURL* curl; //! curl instance
Expand All @@ -41,12 +44,17 @@ class libcurl_wrapper {
}

protected:

//! Ctor.

libcurl_wrapper () : curl(curl_easy_init ()) {
std::cout << "libcurl_wrapper: new instance" << std::endl;
std::cout << "libcurl_wrapper: new instance" << std::endl; //FIXME remove
}

public:

//! Static factory method

static libcurl_wrapper create () {
libcurl_wrapper obj;
// default error buffer is that of the object itself
Expand All @@ -55,7 +63,8 @@ class libcurl_wrapper {
return obj;
}

//! Destructor
//! Dtor.

~libcurl_wrapper() {
if (curl) {
curl_easy_cleanup (curl);
Expand Down

0 comments on commit 3b6eca0

Please sign in to comment.