KiCad PCB EDA Suite
json_settings.h File Reference
#include <core/wx_stl_compat.h>
#include <utility>
#include <wx/string.h>
#include <core/optional.h>
#include <nlohmann/json_fwd.hpp>

Go to the source code of this file.

Classes

class  JSON_SETTINGS
 

Enumerations

enum  SETTINGS_LOC {
  SETTINGS_LOC::USER, SETTINGS_LOC::PROJECT, SETTINGS_LOC::COLORS, SETTINGS_LOC::NESTED,
  SETTINGS_LOC::NONE
}
 

Functions

void to_json (nlohmann::json &aJson, const wxString &aString)
 
void from_json (const nlohmann::json &aJson, wxString &aString)
 

Variables

const wxChar *const traceSettings
 Flag to enable debug output of settings operations and management. More...
 

Enumeration Type Documentation

◆ SETTINGS_LOC

enum SETTINGS_LOC
strong
Enumerator
USER 

The main config directory (e.g. ~/.config/kicad/)

PROJECT 

The settings directory inside a project folder.

COLORS 

The color scheme directory (e.g. ~/.config/kicad/colors/)

NESTED 

Not stored in a file, but inside another JSON_SETTINGS.

NONE 

No directory prepended, full path in filename (used for PROJECT_FILE)

Definition at line 46 of file json_settings.h.

46  {
47  USER,
48  PROJECT,
49  COLORS,
50  NESTED,
51  NONE,
52 };
Container for project specific data.
Definition: project.h:62
The color scheme directory (e.g. ~/.config/kicad/colors/)
No updates are required.
Definition: view_item.h:46
Not stored in a file, but inside another JSON_SETTINGS.
The main config directory (e.g. ~/.config/kicad/)

Function Documentation

◆ from_json()

void from_json ( const nlohmann::json aJson,
wxString &  aString 
)

Definition at line 795 of file json_settings.cpp.

796 {
797  aString = wxString( aJson.get<std::string>().c_str(), wxConvUTF8 );
798 }

◆ to_json()

void to_json ( nlohmann::json aJson,
const wxString &  aString 
)

Definition at line 789 of file json_settings.cpp.

790 {
791  aJson = aString.ToUTF8();
792 }