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 
29 class PATHS
30 {
31 public:
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 GetStockScriptingPath();
93 
97  static wxString GetStockPluginsPath();
98 
102  static wxString GetStockPlugins3DPath();
103 
107  static wxString GetStockDemosPath();
108 
112  static wxString GetUserCachePath();
113 
117  static wxString GetDocumentationPath();
118 
122  static bool EnsurePathExists( const wxString& aPath );
123 
127  static void EnsureUserPathsExist();
128 
129 #ifdef __WXMAC__
130 
135  static wxString GetOSXKicadUserDataDir();
136 
140  static wxString GetOSXKicadMachineDataDir();
141 
145  static wxString GetOSXKicadDataDir();
146 #endif
147 
148 private:
149  // we are a static helper
150  PATHS() {}
151 
157  static void getUserDocumentPath( wxFileName& aPath );
158 
159 #ifdef __WXWINDOWS__
160 
165  static wxString getWindowsKiCadRoot();
166 #endif
167 };
168 
169 #endif
static bool EnsurePathExists(const wxString &aPath)
Attempts to create a given path if it does not exist.
Definition: paths.cpp:291
static wxString GetDefaultUser3DModelsPath()
Gets the default path we point users to create projects.
Definition: paths.cpp:119
static wxString GetUserScriptingPath()
Gets the user path for python scripts.
Definition: paths.cpp:75
static wxString GetStockScriptingPath()
Gets the stock (install) scripting path.
Definition: paths.cpp:202
static wxString GetStockPlugins3DPath()
Gets the stock (install) 3d viewer plugins path.
Definition: paths.cpp:228
PATHS()
Definition: paths.h:150
static wxString GetUserCachePath()
Gets the stock (install) 3d viewer plugins path.
Definition: paths.cpp:263
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 GetDocumentationPath()
Gets the documentation path, which is the base path for help files.
Definition: paths.cpp:275
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 GetUserPlugins3DPath()
Gets the user path for 3d viewer plugin.
Definition: paths.cpp:64
static wxString GetUserPluginsPath()
Gets the user path for plugins.
Definition: paths.cpp:53
static wxString GetUserTemplatesPath()
Gets the user path for custom templates.
Definition: paths.cpp:86
static void EnsureUserPathsExist()
Ensures/creates user default paths.
Definition: paths.cpp:311
static wxString GetDefaultUserProjectsPath()
Gets the default path we point users to create projects.
Definition: paths.cpp:139
static wxString GetDefaultUserSymbolsPath()
Gets the default path we point users to create projects.
Definition: paths.cpp:97
static wxString GetDefaultUserFootprintsPath()
Gets the default path we point users to create projects.
Definition: paths.cpp:108
Helper class to centralize the paths used throughout kicad.
Definition: paths.h:29
static wxString GetStockDemosPath()
Gets the stock (install) demos path.
Definition: paths.cpp:252
static wxString GetStockEDALibraryPath()
Gets the stock (install) EDA library data path, which is the base path for templates,...
Definition: paths.cpp:186
static wxString GetDefault3rdPartyPath()
Gets the default path for PCM packages.
Definition: paths.cpp:129
static wxString GetStockPluginsPath()
Gets the stock (install) plugins path.
Definition: paths.cpp:212