KiCad PCB EDA Suite
project_file.h File Reference

Go to the source code of this file.

Classes

class  PROJECT_FILE
 PROJECT_FILE is the backing store for a PROJECT, in JSON format. More...
 

Typedefs

typedef std::pair< KIID, wxString > FILE_INFO_PAIR
 For files like sheets and boards, a pair of that object KIID and display name Display name is typically blank for the project root sheet. More...
 

Enumerations

enum  LAST_PATH_TYPE : unsigned int {
  LAST_PATH_NETLIST = 0, LAST_PATH_STEP, LAST_PATH_IDF, LAST_PATH_VRML,
  LAST_PATH_SPECCTRADSN, LAST_PATH_GENCAD, LAST_PATH_SIZE
}
 For storing PcbNew MRU paths of various types. More...
 

Functions

void to_json (nlohmann::json &aJson, const FILE_INFO_PAIR &aPair)
 
void from_json (const nlohmann::json &aJson, FILE_INFO_PAIR &aPair)
 

Typedef Documentation

◆ FILE_INFO_PAIR

typedef std::pair<KIID, wxString> FILE_INFO_PAIR

For files like sheets and boards, a pair of that object KIID and display name Display name is typically blank for the project root sheet.

Definition at line 33 of file project_file.h.

Enumeration Type Documentation

◆ LAST_PATH_TYPE

enum LAST_PATH_TYPE : unsigned int

For storing PcbNew MRU paths of various types.

Enumerator
LAST_PATH_NETLIST 
LAST_PATH_STEP 
LAST_PATH_IDF 
LAST_PATH_VRML 
LAST_PATH_SPECCTRADSN 
LAST_PATH_GENCAD 
LAST_PATH_SIZE 

Definition at line 44 of file project_file.h.

Function Documentation

◆ from_json()

void from_json ( const nlohmann::json aJson,
FILE_INFO_PAIR aPair 
)

Definition at line 573 of file project_file.cpp.

574 {
575  wxASSERT( aJson.is_array() && aJson.size() == 2 );
576  aPair.first = KIID( wxString( aJson[0].get<std::string>().c_str(), wxConvUTF8 ) );
577  aPair.second = wxString( aJson[1].get<std::string>().c_str(), wxConvUTF8 );
578 }
Definition: common.h:70

◆ to_json()

void to_json ( nlohmann::json aJson,
const FILE_INFO_PAIR aPair 
)

Definition at line 567 of file project_file.cpp.

568 {
569  aJson = nlohmann::json::array( { aPair.first.AsString().ToUTF8(), aPair.second.ToUTF8() } );
570 }