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

Go to the source code of this file.

Classes

class  JSON_SETTINGS
 

Enumerations

enum class  SETTINGS_LOC {
  USER , PROJECT , COLORS , NESTED ,
  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 class 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 47 of file json_settings.h.

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

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}