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

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 44 of file json_settings.h.

44  {
45  USER,
46  PROJECT,
47  COLORS,
48  NESTED,
49  NONE,
50 };
PROJECT holds project specific data.
Definition: project.h:61
The color scheme directory (e.g. ~/.config/kicad/colors/)
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 659 of file json_settings.cpp.

660 {
661  aString = wxString( aJson.get<std::string>().c_str(), wxConvUTF8 );
662 }

◆ to_json()

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

Definition at line 653 of file json_settings.cpp.

654 {
655  aJson = aString.ToUTF8();
656 }