-
Notifications
You must be signed in to change notification settings - Fork 1
/
curlUtilities.cpp
37 lines (32 loc) · 892 Bytes
/
curlUtilities.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// File: curlUtilities.cpp
// Date: 11/22/2017
// Auth: K. Loux
// Desc: Utilities for working with libCURL.
// Local headers
#include "curlUtilities.h"
// Standard C++ headers
#include <iostream>
//==========================================================================
// Class: CURLUtilities
// Function: CURLCallHasError
//
// Description: Wrapper for checking return codes on CURL calls.
//
// Input Arguments:
// result = const CURLcode&
// message = const UString::String&
//
// Output Arguments:
// None
//
// Return Value:
// bool, true for success, false otherwise
//
//==========================================================================
bool CURLUtilities::CURLCallHasError(const CURLcode& result, const UString::String& message)
{
if (result == CURLE_OK)
return false;
Cerr << message << ": " << curl_easy_strerror(result) << '\n';
return true;
}