KiCad PCB EDA Suite
project_file.h File Reference

Go to the source code of this file.

Classes

class  PROJECT_FILE
 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 41 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 46 of file project_file.h.

47{
54
56};
@ LAST_PATH_SPECCTRADSN
Definition: project_file.h:52
@ LAST_PATH_GENCAD
Definition: project_file.h:53
@ LAST_PATH_SIZE
Definition: project_file.h:55
@ LAST_PATH_IDF
Definition: project_file.h:50
@ LAST_PATH_VRML
Definition: project_file.h:51
@ LAST_PATH_NETLIST
Definition: project_file.h:48
@ LAST_PATH_STEP
Definition: project_file.h:49

Function Documentation

◆ from_json()

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

Definition at line 600 of file project_file.cpp.

601{
602 wxCHECK( aJson.is_array() && aJson.size() == 2, /* void */ );
603 aPair.first = KIID( wxString( aJson[0].get<std::string>().c_str(), wxConvUTF8 ) );
604 aPair.second = wxString( aJson[1].get<std::string>().c_str(), wxConvUTF8 );
605}
Definition: kiid.h:48

◆ to_json()

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

Definition at line 594 of file project_file.cpp.

595{
596 aJson = nlohmann::json::array( { aPair.first.AsString().ToUTF8(), aPair.second.ToUTF8() } );
597}