Skip to content

Commit cb42631

Browse files
JosephP91JosephP91
authored andcommitted
General warning removal to fix #124
1 parent 14b3ca1 commit cb42631

28 files changed

+126
-90
lines changed

include/cookie.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ namespace curl {
3737
*/
3838
class cookie {
3939
public:
40-
/*
40+
/**
4141
* Default constructor.
4242
*/
43-
cookie() {}
43+
cookie() = default;
4444
/**
45-
* The constructor allow a fast way to build a cookie.
45+
* The overloaded constructor allow a fast way to build a cookie.
4646
*/
4747
cookie(const std::string&, const std::string&, const cookie_datetime &,
4848
const std::string& = "", const std::string& = "", bool = false);

include/cookie_date.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ namespace curl {
4242
// Leave this alone :)
4343
namespace details {
4444
// Map months numbers with months short names (cookies likes it short XD)
45-
static const std::map<int,std::string> months_names = {
45+
static const std::map<int,std::string> monthsNames = {
4646
{JANUARY,"Jan"}, {FEBRUARY,"Feb"}, {MARCH,"Mar"}, {APRIL,"Apr"}, {MAY,"May"}, {JUNE,"Jun"},
4747
{JULY,"Jul"},{AUGUST,"Aug"},{SEPTEMBER,"Sep"},{OCTOBER,"Oct"},{NOVEMBER,"Nov"},{DECEMBER,"Dec"}
4848
};
4949
// Map week days numbers with days short names (cookies likes it, still, short XD)
50-
static const std::map<int,std::string> weekday_names = {
50+
static const std::map<int,std::string> weekdayNames = {
5151
{MONDAY,"Mon"}, {TUESDAY,"Tue"}, {WEDNESDAY,"Wed"}, {THURSDAY,"Thu"}, {FRIDAY,"Fri"}, {SATURDAY,"Sat"},
5252
{SUNDAY,"Sun"}
5353
};

include/cookie_datetime.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ namespace curl {
5454
/**
5555
* This method returns the time object.
5656
*/
57-
const cookie_time get_time() const NOEXCEPT;
57+
cookie_time get_time() const NOEXCEPT;
5858
/**
5959
* This method returns the date object.
6060
*/
61-
const cookie_date get_date() const NOEXCEPT;
61+
cookie_date get_date() const NOEXCEPT;
6262
/**
6363
* This method returns the cookie_datetime as a string.
6464
*/

include/cookie_time.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ namespace curl {
6161
/**
6262
* This method returns the hours.
6363
*/
64-
const unsigned int get_hour() const NOEXCEPT;
64+
unsigned int get_hour() const NOEXCEPT;
6565
/**
6666
* This method returns the minutes.
6767
*/
68-
const unsigned int get_minutes() const NOEXCEPT;
68+
unsigned int get_minutes() const NOEXCEPT;
6969
/**
7070
* This method returns the seconds.
7171
*/
72-
const unsigned int get_seconds() const NOEXCEPT;
72+
unsigned int get_seconds() const NOEXCEPT;
7373
/**
7474
* This method returns the time formatted as h:m:s
7575
*/
76-
std::string get_formatted() NOEXCEPT;
76+
std::string get_formatted() const NOEXCEPT;
7777
private:
7878
/**
7979
* The hours.

include/curl_cookie.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace curl {
5252
* If you pass an empty string or a string containing a non existing file's path,
5353
* the cookie engine will be initialized, but without reading initial cookies.
5454
*/
55-
void set_file(std::string);
55+
void set_file(const std::string&);
5656
/**
5757
* This method allow you to specify a string that represents a cookie. Such a cookie
5858
* can be either a single line in Netscape / Mozilla format or just regular HTTP-style
@@ -67,7 +67,7 @@ namespace curl {
6767
/**
6868
* This method allow you to get all known cookies for a specific domain.
6969
*/
70-
const curlcpp_cookies get() const NOEXCEPT;
70+
curlcpp_cookies get() const NOEXCEPT;
7171
/**
7272
* This method erases all cookies held in memory.
7373
*/

include/curl_easy.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,14 @@ namespace curl {
175175
CURLCPP_DEFINE_OPTION(CURLOPT_ERRORBUFFER, char*);
176176
/* Function that will be called to store the output (instead of fwrite). The
177177
* parameters will use fwrite() syntax, make sure to follow them. */
178-
CURLCPP_DEFINE_OPTION(CURLOPT_WRITEFUNCTION, size_t(*)(void *ptr, size_t size, size_t nmemb, void *userdata));
178+
CURLCPP_DEFINE_OPTION(CURLOPT_WRITEFUNCTION,
179+
size_t(*)(void *ptr, size_t size, size_t nmemb, void *userdata));
180+
179181
/* Function that will be called to read the input (instead of fread). The
180182
* parameters will use fread() syntax, make sure to follow them. */
181-
CURLCPP_DEFINE_OPTION(CURLOPT_READFUNCTION, size_t(*)(void *buffer, size_t size, size_t nitems, void *instream));
183+
CURLCPP_DEFINE_OPTION(CURLOPT_READFUNCTION,
184+
size_t(*)(void *buffer, size_t size, size_t nitems, void *instream));
185+
182186
/* Time-out the read operation after this amount of seconds */
183187
CURLCPP_DEFINE_OPTION(CURLOPT_TIMEOUT, long);
184188
/* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
@@ -383,7 +387,8 @@ namespace curl {
383387

384388
/* Function that will be called to store headers (instead of fwrite). The
385389
* parameters will use fwrite() syntax, make sure to follow them. */
386-
CURLCPP_DEFINE_OPTION(CURLOPT_HEADERFUNCTION, size_t(*)(void *buffer, size_t size, size_t nitems, void *userdata));
390+
CURLCPP_DEFINE_OPTION(CURLOPT_HEADERFUNCTION,
391+
size_t(*)(void *buffer, size_t size, size_t nitems, void *userdata));
387392

388393
/* Set this to force the HTTP request to get back to GET. Only really usable
389394
if POST, PUT or a custom request have been used first.
@@ -495,7 +500,8 @@ namespace curl {
495500
/* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
496501
in second argument. The function must be matching the
497502
curl_ssl_ctx_callback proto. */
498-
CURLCPP_DEFINE_OPTION(CURLOPT_SSL_CTX_FUNCTION, CURLcode(*)(CURL *curl, void *ssl_ctx, void *userptr));
503+
CURLCPP_DEFINE_OPTION(CURLOPT_SSL_CTX_FUNCTION,
504+
CURLcode(*)(CURL *curl, void *ssl_ctx, void *userptr));
499505

500506
/* Set the userdata for the ssl context callback function's third
501507
argument */

include/curl_exception.h

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ namespace curl {
102102
// Implementation of print_traceback
103103
inline void curl_exception::print_traceback() const {
104104
curl_exception::tracebackLocker.lock();
105-
std::for_each(curl_exception::traceback.begin(),curl_exception::traceback.end(),[](const curlcpp_traceback_object &value) {
105+
std::for_each(curl_exception::traceback.begin(),curl_exception::traceback.end(),
106+
[](const curlcpp_traceback_object &value) {
107+
106108
std::cout<<"ERROR: "<<value.first<<" ::::: FUNCTION: "<<value.second<<std::endl;
107109
});
108110
curl_exception::tracebackLocker.unlock();
@@ -141,11 +143,14 @@ namespace curl {
141143
* This constructor allows to specify a custom error message and the method name where
142144
* the exception has been thrown.
143145
*/
144-
curl_easy_exception(const std::string &error, const std::string &method) : curl_exception(error,method), code(CURLE_OK) {}
146+
curl_easy_exception(const std::string &error, const std::string &method) :
147+
curl_exception(error,method), code(CURLE_OK) {}
148+
145149
/**
146150
* The constructor will transform a CURLcode error in a proper error message.
147151
*/
148-
curl_easy_exception(const CURLcode &code, const std::string &method) : curl_exception(curl_easy_strerror(code),method), code(code) {}
152+
curl_easy_exception(const CURLcode &code, const std::string &method) :
153+
curl_exception(curl_easy_strerror(code),method), code(code) {}
149154

150155
/**
151156
* Returns the error code if there is one. Returns CURLE_OK if none has been set.
@@ -167,11 +172,13 @@ namespace curl {
167172
* This constructor enables setting a custom error message and the method name where
168173
* the exception has been thrown.
169174
*/
170-
curl_multi_exception(const std::string &error, const std::string &method) : curl_exception(error,method), code(CURLM_OK) {}
175+
curl_multi_exception(const std::string &error, const std::string &method) :
176+
curl_exception(error,method), code(CURLM_OK) {}
171177
/**
172178
* The constructor will transform a CURLMcode error to a proper error message.
173179
*/
174-
curl_multi_exception(const CURLMcode code, const std::string &method) : curl_exception(curl_multi_strerror(code),method), code(code) {}
180+
curl_multi_exception(const CURLMcode code, const std::string &method) :
181+
curl_exception(curl_multi_strerror(code),method), code(code) {}
175182

176183
/**
177184
* Returns the error code if there is one. Returns CURLM_OK if none has been set.
@@ -193,11 +200,13 @@ namespace curl {
193200
* This constructor enables setting a custom error message and the method name where
194201
* the exception has been thrown.
195202
*/
196-
curl_share_exception(const std::string &error, const std::string &method) : curl_exception(error,method), code(CURLSHE_OK) {}
203+
curl_share_exception(const std::string &error, const std::string &method) :
204+
curl_exception(error,method), code(CURLSHE_OK) {}
197205
/**
198206
* The constructor will transform a CURLSHcode error in a proper error message.
199207
*/
200-
curl_share_exception(const CURLSHcode code, const std::string &method) : curl_exception(curl_share_strerror(code),method), code(code) {}
208+
curl_share_exception(const CURLSHcode code, const std::string &method) :
209+
curl_exception(curl_share_strerror(code),method), code(code) {}
201210

202211
/**
203212
* Returns the error code if there is one. Returns CURLE_OK if none has been set.

include/curl_form.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,33 @@ namespace curl {
7070
/**
7171
* Overloaded add method.
7272
*/
73-
void add(const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption,std::string> &);
73+
void add(const curl_pair<CURLformoption,std::string> &,
74+
const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption,std::string> &);
7475
/**
7576
* Overloaded add method. It adds another curl_pair object to add more
7677
* contents to the form contents list.
7778
*/
78-
void add(const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption,int> &);
79+
void add(const curl_pair<CURLformoption,std::string> &,
80+
const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption,int> &);
7981
/**
8082
* Overloaded add method. It adds another curl_pair object to add more
8183
* contents to the form contents list.
8284
*/
83-
void add(const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption,int> &, const curl_pair<CURLformoption,std::string> &);
85+
void add(const curl_pair<CURLformoption,std::string> &,
86+
const curl_pair<CURLformoption,int> &, const curl_pair<CURLformoption,std::string> &);
8487
/**
8588
* Overloaded add method. It adds another curl_pair object to add more
8689
* contents to the form contents list.
8790
*/
88-
void add(const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption,int> &, const curl_pair<CURLformoption,std::string> &);
91+
void add(const curl_pair<CURLformoption,std::string> &,const curl_pair<CURLformoption,std::string> &,
92+
const curl_pair<CURLformoption,int> &, const curl_pair<CURLformoption,std::string> &);
8993
/**
9094
* Overloaded add method. Used primarily to pass data via CURLFORM_BUFFERPTR.
9195
* E.g. first option is content name, second is buffer name,
9296
* third is buffer data pointer, fourth is buffer length.
9397
*/
94-
void add(const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption, char*> &, const curl_pair<CURLformoption,long> &);
98+
void add(const curl_pair<CURLformoption,std::string> &, const curl_pair<CURLformoption,std::string> &,
99+
const curl_pair<CURLformoption, char*> &, const curl_pair<CURLformoption,long> &);
95100
/**
96101
* Overloaded add method. This version is primarily used to upload multiple files.
97102
* You can pass a vector of filenames to upload them.

include/curl_option.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define __curlcpp__curl_option__
2828

2929
#include <string>
30+
#include <curl/curl.h>
3031
#include "curl_pair.h"
3132

3233
namespace curl {

include/curl_pair.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ namespace curl {
110110
* The two parameters constructor gives users a fast way to
111111
* build an object of this type.
112112
*/
113-
curl_pair(const T option, const std::string &value) : option(option == CURLOPT_POSTFIELDS ? CURLOPT_COPYPOSTFIELDS : option), value(value) {};
113+
curl_pair(const T option, const std::string &value) :
114+
option(option == CURLOPT_POSTFIELDS ? CURLOPT_COPYPOSTFIELDS : option), value(value) {};
114115
/**
115116
* Simple method that returns the first field of the pair.
116117
*/

0 commit comments

Comments
 (0)