KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KICAD_CURL Class Reference

Simple wrapper class to call curl_global_init and curl_global_cleanup for KiCad. More...

#include <kicad_curl.h>

Static Public Member Functions

static void Init ()
 Call curl_global_init for the application.
 
static void Cleanup ()
 Call curl_global_cleanup for the application.
 
static std::shared_mutex & Mutex ()
 Returns the mutex for shared locking when performing curl operations.
 
static bool IsShuttingDown ()
 Returns true if all curl operations should terminate.
 
static const char * GetVersion ()
 Wrapper for curl_version().
 

Detailed Description

Simple wrapper class to call curl_global_init and curl_global_cleanup for KiCad.

Definition at line 61 of file kicad_curl.h.

Member Function Documentation

◆ Cleanup()

void KICAD_CURL::Cleanup ( )
static

Call curl_global_cleanup for the application.

It must be used only after curl_global_init was called.

Definition at line 49 of file kicad_curl.cpp.

References s_curlMutex, and s_curlShuttingDown.

Referenced by PGM_BASE::Destroy().

◆ GetVersion()

static const char * KICAD_CURL::GetVersion ( )
inlinestatic

Wrapper for curl_version().

Reports back a short string of loaded libraries.

Returns
String reported by libcurl and owned by it.
Exceptions
IO_ERRORon failure, hopefully with helpful text in it.

Definition at line 96 of file kicad_curl.h.

Referenced by GetKicadCurlVersion().

◆ Init()

void KICAD_CURL::Init ( )
static

Call curl_global_init for the application.

It must be used only once and before any curl functions that perform requests.

Returns
True if successful, false if CURL returned an error.
Exceptions
IO_ERRORon failure, hopefully with helpful text in it.

Definition at line 38 of file kicad_curl.cpp.

References s_curlShuttingDown, and THROW_IO_ERROR.

Referenced by PGM_BASE::InitPgm().

◆ IsShuttingDown()

bool KICAD_CURL::IsShuttingDown ( )
static

Returns true if all curl operations should terminate.

Definition at line 65 of file kicad_curl.cpp.

References s_curlShuttingDown.

◆ Mutex()

std::shared_mutex & KICAD_CURL::Mutex ( )
static

Returns the mutex for shared locking when performing curl operations.

Unique locking is performed when shutting down.

Definition at line 59 of file kicad_curl.cpp.

References s_curlMutex.

Referenced by KICAD_CURL_EASY::Perform().


The documentation for this class was generated from the following files: