#ifndef EASY_CURL_H
#define EASY_CURL_H

#include <fstream>
#include <string>

#include <curl/curl.h>

class easy_curl
{

public:

	easy_curl();
	~easy_curl();

	CURLcode upload(const std::string& from, const std::string& to);

	CURLcode ftp_cmd(const std::string& url, const std::string& cmd);

	CURLcode get_err_no() const;
	std::string get_err_str() const;

private:

	CURL* m_curl;
	CURLcode m_error;
	std::ifstream m_infile;

	void reset();
	static size_t data_reader(void* buffer, size_t size, size_t bytes, void* object);

};

#endif

