KiCad PCB EDA Suite
Loading...
Searching...
No Matches
http_lib_connection.cpp File Reference
#include <wx/log.h>
#include <fmt/core.h>
#include <wx/translation.h>
#include <ctime>
#include <boost/algorithm/string.hpp>
#include <json_common.h>
#include <wx/base64.h>
#include <kicad_curl/kicad_curl_easy.h>
#include <curl/curl.h>
#include <http_lib/http_lib_connection.h>
#include <lib_id.h>

Go to the source code of this file.

Functions

bool boolFromString (const std::any &aVal, bool aDefaultValue)
 
void setPartIdNameAndMetadata (const nlohmann::json &aPart_json, HTTP_LIB_PART &aPart)
 
static bool jsonBoolField (const nlohmann::json &aValue, bool aDefault)
 
bool setPartExtendedData (const nlohmann::json &aPartJson, HTTP_LIB_PART &aPart)
 Parse the exclusion flags and field content from a part's JSON record into aPart.
 

Variables

const char *const traceHTTPLib = "KICAD_HTTP_LIB"
 

Function Documentation

◆ boolFromString()

bool boolFromString ( const std::any & aVal,
bool aDefaultValue )

Definition at line 154 of file http_lib_connection.cpp.

Referenced by jsonBoolField().

◆ jsonBoolField()

static bool jsonBoolField ( const nlohmann::json & aValue,
bool aDefault )
static

Definition at line 224 of file http_lib_connection.cpp.

References boolFromString().

Referenced by setPartExtendedData().

◆ setPartExtendedData()

bool setPartExtendedData ( const nlohmann::json & aPartJson,
HTTP_LIB_PART & aPart )

Parse the exclusion flags and field content from a part's JSON record into aPart.

The category listing and per-part detail endpoints share this shape but the listing may omit the fields; parsing is tolerant of missing keys and of flags encoded as either JSON strings or native booleans.

Returns
true if the record carried a fields object (the part's full detail is present).

Definition at line 236 of file http_lib_connection.cpp.

References HTTP_LIB_PART::exclude_from_board, HTTP_LIB_PART::exclude_from_bom, HTTP_LIB_PART::exclude_from_sim, HTTP_LIB_PART::fields, jsonBoolField(), and HTTP_LIB_PART::symbolIdStr.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), HTTP_LIB_CONNECTION::SelectAll(), and HTTP_LIB_CONNECTION::SelectOne().

◆ setPartIdNameAndMetadata()

Variable Documentation

◆ traceHTTPLib