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 
26 class PATHS
27 {
28 public:
29 
33  static wxString GetUserScriptingPath();
34 
38  static wxString GetUserTemplatesPath();
39 
43  static wxString GetUserPluginsPath();
44 
48  static wxString GetUserPlugins3DPath();
49 
53  static wxString GetDefaultUserProjectsPath();
54 
58  static wxString GetDefaultUserSymbolsPath();
59 
63  static wxString GetDefaultUserFootprintsPath();
64 
68  static wxString GetDefaultUser3DModelsPath();
69 
73  static wxString GetStockDataPath( bool aRespectRunFromBuildDir = true );
74 
79  static wxString GetStockEDALibraryPath();
80 
84  static wxString GetStockScriptingPath();
85 
89  static wxString GetStockPluginsPath();
90 
94  static wxString GetStockPlugins3DPath();
95 
99  static wxString GetUserCachePath();
100 
104  static bool EnsurePathExists( const wxString& aPath );
105 
109  static void EnsureUserPathsExist();
110 
111 #ifdef __WXMAC__
112 
117  static wxString GetOSXKicadUserDataDir();
118 
122  static wxString GetOSXKicadMachineDataDir();
123 
127  static wxString GetOSXKicadDataDir();
128 #endif
129 
130 private:
131  // we are a static helper
132  PATHS() {}
133 
139  static void getUserDocumentPath( wxFileName& aPath );
140 };
141 
142 #endif
static bool EnsurePathExists(const wxString &aPath)
Attempts to create a given path if it does not exist.
Definition: paths.cpp:243
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:181
static wxString GetStockPlugins3DPath()
Gets the stock (install) 3d viewer pluginspath.
Definition: paths.cpp:207
PATHS()
Definition: paths.h:132
static wxString GetUserCachePath()
Gets the stock (install) 3d viewer pluginspath.
Definition: paths.cpp:231
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 GetStockDataPath(bool aRespectRunFromBuildDir=true)
Gets the stock (install) data path, which is the base path for things like scripting,...
Definition: paths.cpp:141
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:263
static wxString GetDefaultUserProjectsPath()
Gets the default path we point users to create projects.
Definition: paths.cpp:130
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:26
static wxString GetStockEDALibraryPath()
Gets the stock (install) EDA library data path, which is the base path for templates,...
Definition: paths.cpp:165
static wxString GetStockPluginsPath()
Gets the stock (install) plugins path.
Definition: paths.cpp:191