KiCad PCB EDA Suite
|
Helper class to centralize the paths used throughout kicad. More...
#include <paths.h>
Static Public Member Functions | |
static wxString | GetUserScriptingPath () |
Gets the user path for python scripts. | |
static wxString | GetUserTemplatesPath () |
Gets the user path for custom templates. | |
static wxString | GetUserPluginsPath () |
Gets the user path for plugins. | |
static wxString | GetDefaultUserProjectsPath () |
Gets the default path we point users to create projects. | |
static wxString | GetDefaultUserSymbolsPath () |
Gets the default path we point users to create projects. | |
static wxString | GetDefaultUserFootprintsPath () |
Gets the default path we point users to create projects. | |
static wxString | GetDefaultUserDesignBlocksPath () |
Gets the default path we point users to create projects. | |
static wxString | GetDefaultUser3DModelsPath () |
Gets the default path we point users to create projects. | |
static wxString | GetStockDataPath (bool aRespectRunFromBuildDir=true) |
Gets the stock (install) data path, which is the base path for things like scripting, etc. | |
static wxString | GetStockEDALibraryPath () |
Gets the stock (install) EDA library data path, which is the base path for templates, schematic symbols, footprints, and 3D models. | |
static wxString | GetDefault3rdPartyPath () |
Gets the default path for PCM packages. | |
static wxString | GetStockSymbolsPath () |
Gets the stock (install) symbols path. | |
static wxString | GetStockFootprintsPath () |
Gets the stock (install) footprints path. | |
static wxString | GetStockDesignBlocksPath () |
Gets the stock (install) footprints path. | |
static wxString | GetStock3dmodelsPath () |
Gets the stock (install) 3dmodels path. | |
static wxString | GetStockScriptingPath () |
Gets the stock (install) scripting path. | |
static wxString | GetStockPluginsPath () |
Gets the stock (install) plugins path. | |
static wxString | GetStockPlugins3DPath () |
Gets the stock (install) 3d viewer plugins path. | |
static wxString | GetStockDemosPath () |
Gets the stock (install) demos path. | |
static wxString | GetStockTemplatesPath () |
Gets the stock (install) templates path. | |
static wxString | GetLocaleDataPath () |
Gets the locales translation data path. | |
static wxString | GetUserCachePath () |
Gets the stock (install) 3d viewer plugins path. | |
static wxString | GetDocumentationPath () |
Gets the documentation path, which is the base path for help files. | |
static wxString | GetInstanceCheckerPath () |
Gets the path used for wxSingleInstanceChecker lock files. | |
static wxString | GetLogsPath () |
Gets a path to use for user-visible log files. | |
static bool | EnsurePathExists (const wxString &aPath, bool aPathToFile=false) |
Attempts to create a given path if it does not exist. | |
static void | EnsureUserPathsExist () |
Ensures/creates user default paths. | |
static wxString | GetUserSettingsPath () |
Return the user configuration path used to store KiCad's configuration files. | |
static wxString | CalculateUserSettingsPath (bool aIncludeVer=true, bool aUseEnv=true) |
Determines the base path for user settings files. | |
static const wxString & | GetExecutablePath () |
Private Member Functions | |
PATHS () | |
Static Private Member Functions | |
static void | getUserDocumentPath (wxFileName &aPath) |
Gets the user path for the current kicad version which acts as the root for other user paths. | |
|
static |
Determines the base path for user settings files.
The configuration path order of precedence is determined by the following criteria:
aIncludeVer | will append the current KiCad version if true (default) |
aUseEnv | will prefer the base path found in the KICAD_CONFIG_DIR if found (default) |
Definition at line 603 of file paths.cpp.
References GetMajorMinorVersion(), KIPLATFORM::ENV::GetUserConfigPath(), and TO_STR.
Referenced by SETTINGS_MANAGER::GetPreviousVersionPaths(), and GetUserSettingsPath().
|
static |
Attempts to create a given path if it does not exist.
Definition at line 477 of file paths.cpp.
References path.
Referenced by EnsureUserPathsExist(), DIALOG_EXPORT_ODBPP::GenerateODBPPFiles(), EMBEDDED_FILES::GetTemporaryFileName(), API_HANDLER_COMMON::handleGetPluginSettingsPath(), PGM_BASE::InitPgm(), EESCHEMA_JOBS_HANDLER::JobExportBom(), PCBNEW_JOBS_HANDLER::JobExportDrc(), PCBNEW_JOBS_HANDLER::JobExportDrill(), PCBNEW_JOBS_HANDLER::JobExportDxf(), PCBNEW_JOBS_HANDLER::JobExportFpSvg(), PCBNEW_JOBS_HANDLER::JobExportGencad(), PCBNEW_JOBS_HANDLER::JobExportGerbers(), PCBNEW_JOBS_HANDLER::JobExportIpc2581(), PCBNEW_JOBS_HANDLER::JobExportIpcD356(), EESCHEMA_JOBS_HANDLER::JobExportNetlist(), PCBNEW_JOBS_HANDLER::JobExportPdf(), EESCHEMA_JOBS_HANDLER::JobExportPlot(), PCBNEW_JOBS_HANDLER::JobExportPos(), PCBNEW_JOBS_HANDLER::JobExportPs(), EESCHEMA_JOBS_HANDLER::JobExportPythonBom(), PCBNEW_JOBS_HANDLER::JobExportRender(), PCBNEW_JOBS_HANDLER::JobExportStep(), PCBNEW_JOBS_HANDLER::JobExportSvg(), EESCHEMA_JOBS_HANDLER::JobSchErc(), and KICAD_API_SERVER::Start().
|
static |
Ensures/creates user default paths.
Definition at line 504 of file paths.cpp.
References EnsurePathExists(), GetDefault3rdPartyPath(), GetDefaultUser3DModelsPath(), GetDefaultUserFootprintsPath(), GetDefaultUserProjectsPath(), GetDefaultUserSymbolsPath(), GetUserCachePath(), GetUserPluginsPath(), GetUserScriptingPath(), and GetUserTemplatesPath().
Referenced by PGM_BASE::InitPgm().
|
static |
Gets the default path for PCM packages.
Definition at line 125 of file paths.cpp.
References getUserDocumentPath().
Referenced by EnsureUserPathsExist(), COMMON_SETTINGS::InitializeEnvironment(), SETTINGS_MANAGER::loadAllColorSettings(), PLUGIN_CONTENT_MANAGER::ReadEnvVar(), and API_PLUGIN_MANAGER::ReloadPlugins().
|
static |
Gets the default path we point users to create projects.
Definition at line 114 of file paths.cpp.
References getUserDocumentPath().
Referenced by EnsureUserPathsExist().
|
static |
Gets the default path we point users to create projects.
Definition at line 103 of file paths.cpp.
References getUserDocumentPath().
Referenced by PANEL_DESIGN_BLOCK_LIB_TABLE::PANEL_DESIGN_BLOCK_LIB_TABLE().
|
static |
Gets the default path we point users to create projects.
Definition at line 92 of file paths.cpp.
References getUserDocumentPath().
Referenced by EnsureUserPathsExist(), and PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE().
|
static |
Gets the default path we point users to create projects.
Definition at line 136 of file paths.cpp.
References getUserDocumentPath().
Referenced by AskLoadBoardFileName(), EDA_BASE_FRAME::commonInit(), PCB_EDIT_FRAME::DoAutoSave(), EnsureUserPathsExist(), KICAD_MANAGER_CONTROL::NewFromTemplate(), KICAD_MANAGER_CONTROL::newProjectDirectory(), DIALOG_GENDRILL::onGenReportFile(), PROJECT_TREE_PANE::onOpenDirectory(), KICAD_MANAGER_CONTROL::openProject(), PROJECT_TREE_PANE::ReCreateTreePrj(), PCB_EDIT_FRAME::SaveBoard(), SCH_EDIT_FRAME::SaveProject(), KICAD_MANAGER_CONTROL::SaveProjectAs(), and ROUTER_TOOL::saveRouterDebugLog().
|
static |
Gets the default path we point users to create projects.
Definition at line 81 of file paths.cpp.
References getUserDocumentPath().
Referenced by EnsureUserPathsExist(), and PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE().
|
static |
Gets the documentation path, which is the base path for help files.
Definition at line 440 of file paths.cpp.
References path.
Referenced by SearchHelpFileFullPath().
|
static |
Definition at line 629 of file paths.cpp.
References WX_FILENAME::ResolvePossibleSymlinks(), UNIX_STRING_DIR_SEP, and WIN_STRING_DIR_SEP.
Referenced by getBuildDirectoryRoot(), PGM_BASE::GetExecutablePath(), GetStockPlugins3DPath(), GetStockPluginsPath(), and PGM_SINGLE_TOP::OnPgmInit().
|
static |
Gets the path used for wxSingleInstanceChecker lock files.
Definition at line 456 of file paths.cpp.
References path.
Referenced by PGM_BASE::InitPgm().
|
static |
Gets the locales translation data path.
Definition at line 317 of file paths.cpp.
References GetStockDataPath(), and path.
Referenced by PGM_BASE::SetLanguagePath().
|
static |
Gets a path to use for user-visible log files.
Definition at line 466 of file paths.cpp.
References getUserDocumentPath().
Referenced by KICAD_API_SERVER::Start().
|
static |
Gets the stock (install) 3dmodels path.
Definition at line 287 of file paths.cpp.
References GetStockEDALibraryPath(), and path.
|
static |
Gets the stock (install) data path, which is the base path for things like scripting, etc.
Definition at line 191 of file paths.cpp.
References getBuildDirectoryRoot(), and path.
Referenced by API_PLUGIN_MANAGER::API_PLUGIN_MANAGER(), BITMAP_STORE::BITMAP_STORE(), GetBitmapStore(), GetLocaleDataPath(), GetStockDemosPath(), GetStockEDALibraryPath(), GetStockPluginsPath(), GetStockScriptingPath(), SETTINGS_MANAGER::loadAllColorSettings(), and PLUGIN_CONTENT_MANAGER::PLUGIN_CONTENT_MANAGER().
|
static |
Gets the stock (install) demos path.
Definition at line 408 of file paths.cpp.
References GetStockDataPath().
Referenced by KICAD_MANAGER_FRAME::doReCreateMenuBar(), and KICAD_MANAGER_CONTROL::OpenDemoProject().
|
static |
Gets the stock (install) footprints path.
Definition at line 277 of file paths.cpp.
References GetStockEDALibraryPath(), and path.
|
static |
Gets the stock (install) EDA library data path, which is the base path for templates, schematic symbols, footprints, and 3D models.
Definition at line 241 of file paths.cpp.
References GetStockDataPath(), and path.
Referenced by GetStock3dmodelsPath(), GetStockDesignBlocksPath(), GetStockFootprintsPath(), GetStockSymbolsPath(), GetStockTemplatesPath(), COMMON_SETTINGS::InitializeEnvironment(), and SystemDirsAppend().
|
static |
Gets the stock (install) footprints path.
Definition at line 267 of file paths.cpp.
References GetStockEDALibraryPath(), and path.
|
static |
Gets the stock (install) 3d viewer plugins path.
Definition at line 343 of file paths.cpp.
References GetExecutablePath().
Referenced by S3D_PLUGIN_MANAGER::loadPlugins().
|
static |
Gets the stock (install) plugins path.
Definition at line 327 of file paths.cpp.
References GetExecutablePath(), and GetStockDataPath().
Referenced by BOM_GENERATOR_HANDLER::FindFilePath(), DIALOG_BOM::pluginInit(), and API_PLUGIN_MANAGER::ReloadPlugins().
|
static |
Gets the stock (install) scripting path.
Definition at line 297 of file paths.cpp.
References GetStockDataPath(), and path.
|
static |
Gets the stock (install) symbols path.
Definition at line 257 of file paths.cpp.
References GetStockEDALibraryPath(), and path.
|
static |
Gets the stock (install) templates path.
Definition at line 307 of file paths.cpp.
References GetStockEDALibraryPath(), and path.
Referenced by COMMON_SETTINGS::InitializeEnvironment().
|
static |
Gets the stock (install) 3d viewer plugins path.
Definition at line 419 of file paths.cpp.
References GetMajorMinorVersion(), KIPLATFORM::ENV::GetUserCachePath(), and KICAD_PATH_STR.
Referenced by BOOST_AUTO_TEST_CASE(), PLUGIN_CONTENT_MANAGER::CacheRepository(), PLUGIN_CONTENT_MANAGER::DiscardRepositoryCache(), PCM_TASK_MANAGER::DownloadAndInstall(), EnsureUserPathsExist(), PLUGIN_CONTENT_MANAGER::GetRepositoryPackageBitmaps(), EMBEDDED_FILES::GetTemporaryFileName(), NOTIFICATIONS_MANAGER::NOTIFICATIONS_MANAGER(), NETLIST_EXPORTER_SPICE::readModel(), NETLIST_EXPORTER_SPICE::ReadSchematicAndLibraries(), APP_MONITOR::SENTRY::sentryInit(), and S3D_CACHE::Set3DConfigDir().
|
staticprivate |
Gets the user path for the current kicad version which acts as the root for other user paths.
aPath | Variable to receive the path |
Definition at line 34 of file paths.cpp.
References KIPLATFORM::ENV::GetDocumentsPath(), GetMajorMinorVersion(), and KICAD_PATH_STR.
Referenced by GetDefault3rdPartyPath(), GetDefaultUser3DModelsPath(), GetDefaultUserDesignBlocksPath(), GetDefaultUserFootprintsPath(), GetDefaultUserProjectsPath(), GetDefaultUserSymbolsPath(), GetLogsPath(), GetUserPluginsPath(), GetUserScriptingPath(), and GetUserTemplatesPath().
|
static |
Gets the user path for plugins.
Definition at line 48 of file paths.cpp.
References getUserDocumentPath().
Referenced by DIALOG_BOM::chooseGenerator(), EnsureUserPathsExist(), BOM_GENERATOR_HANDLER::FindFilePath(), DIALOG_BOM::pluginInit(), and API_PLUGIN_MANAGER::ReloadPlugins().
|
static |
Gets the user path for python scripts.
Definition at line 59 of file paths.cpp.
References getUserDocumentPath().
Referenced by EnsureUserPathsExist().
|
static |
Return the user configuration path used to store KiCad's configuration files.
NOTE: The path is cached at startup, it will never change during program lifetime!
Definition at line 592 of file paths.cpp.
References CalculateUserSettingsPath().
Referenced by PROJECT_PCB::Get3DCacheManager(), getAdvancedCfgFilename(), SETTINGS_MANAGER::GetColorSettingsPath(), SYMBOL_LIB_TABLE::GetGlobalTableFileName(), DESIGN_BLOCK_LIB_TABLE::GetGlobalTableFileName(), FP_LIB_TABLE::GetGlobalTableFileName(), SETTINGS_MANAGER::GetPathForSettingsFile(), SETTINGS_MANAGER::GetToolbarSettingsPath(), SETTINGS_MANAGER::GetUserSettingsPath(), API_HANDLER_COMMON::handleGetPluginSettingsPath(), SETTINGS_MANAGER::MigrateIfNeeded(), COMMON_SETTINGS::migrateSchema2to3(), PAGED_DIALOG::onOpenPrefsDir(), PLUGIN_CONTENT_MANAGER::PLUGIN_CONTENT_MANAGER(), ReadHotKeyConfig(), ReadLegacyHotkeyConfigFile(), PLUGIN_CONTENT_MANAGER::SaveInstalledPackages(), and WriteHotKeyConfig().
|
static |
Gets the user path for custom templates.
Definition at line 70 of file paths.cpp.
References getUserDocumentPath().
Referenced by EnsureUserPathsExist(), PL_EDITOR_FRAME::Files_io(), COMMON_SETTINGS::InitializeEnvironment(), and PGM_KICAD::OnPgmInit().