KiCad PCB EDA Suite
paths.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef PATHS_H
21#define PATHS_H
22
23#include <wx/filename.h>
24#include <wx/string.h>
25
29class PATHS
30{
31public:
32
36 static wxString GetUserScriptingPath();
37
41 static wxString GetUserTemplatesPath();
42
46 static wxString GetUserPluginsPath();
47
51 static wxString GetUserPlugins3DPath();
52
56 static wxString GetDefaultUserProjectsPath();
57
61 static wxString GetDefaultUserSymbolsPath();
62
66 static wxString GetDefaultUserFootprintsPath();
67
71 static wxString GetDefaultUser3DModelsPath();
72
76 static wxString GetStockDataPath( bool aRespectRunFromBuildDir = true );
77
82 static wxString GetStockEDALibraryPath();
83
87 static wxString GetDefault3rdPartyPath();
88
92 static wxString GetStockSymbolsPath();
93
97 static wxString GetStockFootprintsPath();
98
102 static wxString GetStock3dmodelsPath();
103
107 static wxString GetStockScriptingPath();
108
112 static wxString GetStockPluginsPath();
113
117 static wxString GetStockPlugins3DPath();
118
122 static wxString GetStockDemosPath();
123
127 static wxString GetStockTemplatesPath();
128
132 static wxString GetLocaleDataPath();
133
137 static wxString GetUserCachePath();
138
142 static wxString GetDocumentationPath();
143
147 static bool EnsurePathExists( const wxString& aPath );
148
152 static void EnsureUserPathsExist();
153
154#ifdef __WXMAC__
160 static wxString GetOSXKicadUserDataDir();
161
165 static wxString GetOSXKicadMachineDataDir();
166
170 static wxString GetOSXKicadDataDir();
171#endif
172
173private:
174 // we are a static helper
175 PATHS() {}
176
182 static void getUserDocumentPath( wxFileName& aPath );
183
184#ifdef __WXWINDOWS__
190 static wxString getWindowsKiCadRoot();
191#endif
192};
193
194#endif
Helper class to centralize the paths used throughout kicad.
Definition: paths.h:30
static wxString GetUserPluginsPath()
Gets the user path for plugins.
Definition: paths.cpp:53
static wxString GetStockSymbolsPath()
Gets the stock (install) symbols path.
Definition: paths.cpp:202
static wxString GetDefaultUser3DModelsPath()
Gets the default path we point users to create projects.
Definition: paths.cpp:119
static wxString GetUserTemplatesPath()
Gets the user path for custom templates.
Definition: paths.cpp:86
static void getUserDocumentPath(wxFileName &aPath)
Gets the user path for the current kicad version which acts as the root for other user paths.
Definition: paths.cpp:39
static wxString GetStockEDALibraryPath()
Gets the stock (install) EDA library data path, which is the base path for templates,...
Definition: paths.cpp:186
static wxString GetDefaultUserProjectsPath()
Gets the default path we point users to create projects.
Definition: paths.cpp:139
static wxString GetStockPluginsPath()
Gets the stock (install) plugins path.
Definition: paths.cpp:262
static wxString GetUserPlugins3DPath()
Gets the user path for 3d viewer plugin.
Definition: paths.cpp:64
static void EnsureUserPathsExist()
Ensures/creates user default paths.
Definition: paths.cpp:369
static wxString GetDocumentationPath()
Gets the documentation path, which is the base path for help files.
Definition: paths.cpp:333
static bool EnsurePathExists(const wxString &aPath)
Attempts to create a given path if it does not exist.
Definition: paths.cpp:349
static wxString GetDefault3rdPartyPath()
Gets the default path for PCM packages.
Definition: paths.cpp:129
static wxString GetStockPlugins3DPath()
Gets the stock (install) 3d viewer plugins path.
Definition: paths.cpp:278
static wxString GetStockDataPath(bool aRespectRunFromBuildDir=true)
Gets the stock (install) data path, which is the base path for things like scripting,...
Definition: paths.cpp:150
static wxString GetDefaultUserFootprintsPath()
Gets the default path we point users to create projects.
Definition: paths.cpp:108
static wxString GetStock3dmodelsPath()
Gets the stock (install) 3dmodels path.
Definition: paths.cpp:222
static wxString GetStockTemplatesPath()
Gets the stock (install) templates path.
Definition: paths.cpp:242
static wxString GetUserCachePath()
Gets the stock (install) 3d viewer plugins path.
Definition: paths.cpp:321
static wxString GetUserScriptingPath()
Gets the user path for python scripts.
Definition: paths.cpp:75
static wxString GetDefaultUserSymbolsPath()
Gets the default path we point users to create projects.
Definition: paths.cpp:97
static wxString GetStockDemosPath()
Gets the stock (install) demos path.
Definition: paths.cpp:310
static wxString GetLocaleDataPath()
Gets the locales translation data path.
Definition: paths.cpp:252
PATHS()
Definition: paths.h:175
static wxString GetStockFootprintsPath()
Gets the stock (install) footprints path.
Definition: paths.cpp:212
static wxString GetStockScriptingPath()
Gets the stock (install) scripting path.
Definition: paths.cpp:232