KiCad PCB EDA Suite
Loading...
Searching...
No Matches
json_settings.h File Reference
#include <core/wx_stl_compat.h>
#include <gal/gal_display_options.h>
#include <utility>
#include <wx/string.h>
#include <functional>
#include <optional>
#include <settings/json_settings_internals.h>
#include <json_conversions.h>
#include <kicommon.h>

Go to the source code of this file.

Classes

class  JSON_SETTINGS
 

Namespaces

namespace  KIGFX
 The Cairo implementation of the graphics abstraction layer.
 

Macros

#define traceSettings   wxT( "KICAD_SETTINGS" )
 

Enumerations

enum class  SETTINGS_LOC {
  USER , PROJECT , COLORS , TOOLBARS ,
  NESTED , NONE
}
 

Functions

KICOMMON_API void to_json (nlohmann::json &aJson, const wxString &aString)
 
KICOMMON_API void from_json (const nlohmann::json &aJson, wxString &aString)
 
template std::optional< std::string > JSON_SETTINGS::Get< std::string > (const std::string &aPath) const
 
template std::optional< nlohmann::json > JSON_SETTINGS::Get< nlohmann::json > (const std::string &aPath) const
 
template std::optional< KIGFX::COLOR4DJSON_SETTINGS::Get< KIGFX::COLOR4D > (const std::string &aPath) const
 
template std::optional< KIGFX::CROSS_HAIR_MODEJSON_SETTINGS::Get< KIGFX::CROSS_HAIR_MODE > (const std::string &aPath) const
 

Macro Definition Documentation

◆ traceSettings

#define traceSettings   wxT( "KICAD_SETTINGS" )

Definition at line 53 of file json_settings.h.

Referenced by JSON_SETTINGS::AddNestedSettings(), SETTINGS_MANAGER::BackupProject(), SETTINGS_MANAGER::compareVersions(), SETTINGS_MANAGER::FlushAndRelease(), SETTINGS_MANAGER::GetColorSettingsPath(), COMMON_SETTINGS::getLegacy3DHollerith(), SETTINGS_MANAGER::GetPreviousVersionPaths(), SETTINGS_MANAGER::GetToolbarSettingsPath(), JSON_SETTINGS::JSON_SETTINGS(), JSON_SETTINGS::Load(), SETTINGS_MANAGER::loadColorSettingsByName(), JSON_SETTINGS::LoadFromFile(), NESTED_SETTINGS::LoadFromFile(), PROJECT_FILE::LoadFromFile(), JSON_SETTINGS::LoadFromRawFile(), SIMULATOR_FRAME_UI::loadJsonWorkbook(), SETTINGS_MANAGER::LoadProject(), JSON_SETTINGS::Migrate(), COMMON_SETTINGS::MigrateFromLegacy(), JSON_SETTINGS::MigrateFromLegacy(), PROJECT_FILE::MigrateFromLegacy(), SETTINGS_MANAGER::MigrateFromPreviousVersion(), COLOR_SETTINGS::migrateSchema0to1(), COMMON_SETTINGS::migrateSchema0to1(), FOOTPRINT_EDITOR_SETTINGS::migrateSchema0to1(), COMMON_SETTINGS::migrateSchema1to2(), COMMON_SETTINGS::migrateSchema3to4(), MIGRATION_TRAVERSER::OnFile(), COMMON_SETTINGS::readLegacy3DResolverCfg(), SETTINGS_MANAGER::registerSettings(), JSON_SETTINGS::ReleaseNestedSettings(), SETTINGS_MANAGER::Save(), SETTINGS_MANAGER::SaveColorSettings(), JSON_SETTINGS::SaveToFile(), NESTED_SETTINGS::SaveToFile(), SETTINGS_MANAGER::SETTINGS_MANAGER(), SETTINGS_MANAGER::SettingsDirectoryValid(), SETTINGS_MANAGER::TriggerBackupIfNeeded(), and SETTINGS_MANAGER::UnloadProject().

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/)

TOOLBARS 

The toolbar directory (e.g. ~/.config/kicad/toolbars/)

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

Function Documentation

◆ from_json()

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

Definition at line 30 of file json_conversions.cpp.

◆ JSON_SETTINGS::Get< KIGFX::COLOR4D >()

template std::optional< KIGFX::COLOR4D > JSON_SETTINGS::Get< KIGFX::COLOR4D > ( const std::string & aPath) const
extern

References JSON_SETTINGS::Get().

◆ JSON_SETTINGS::Get< KIGFX::CROSS_HAIR_MODE >()

template std::optional< KIGFX::CROSS_HAIR_MODE > JSON_SETTINGS::Get< KIGFX::CROSS_HAIR_MODE > ( const std::string & aPath) const
extern

References JSON_SETTINGS::Get().

◆ JSON_SETTINGS::Get< nlohmann::json >()

template std::optional< nlohmann::json > JSON_SETTINGS::Get< nlohmann::json > ( const std::string & aPath) const
extern

References JSON_SETTINGS::Get().

◆ JSON_SETTINGS::Get< std::string >()

template std::optional< std::string > JSON_SETTINGS::Get< std::string > ( const std::string & aPath) const
extern

References JSON_SETTINGS::Get().

◆ to_json()

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

Definition at line 24 of file json_conversions.cpp.