OpenCPN Partial API docs
Loading...
Searching...
No Matches
plugin_paths.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2010 - 2023 by David S. Register *
3 * Copyright (C) 2023 - 2025 Alec Leamas *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 **************************************************************************/
20
26#ifndef MODEL__PLUGIN_PATHS_H
27#define MODEL__PLUGIN_PATHS_H
28#include <string>
29#include <vector>
30
32std::string join(std::vector<std::string> v, char c);
33
36public:
38 static PluginPaths* GetInstance();
39
41 std::string UserLibdir() { return m_userLibdir; };
42
44 std::string UserBindir() { return m_user_bindir; }
45
50 std::string UserDatadir() { return m_user_datadir; }
51
53 std::vector<std::string> Libdirs() { return m_libdirs; }
54
56 std::vector<std::string> Bindirs() { return m_bindirs; };
57
62 std::vector<std::string> Datadirs() { return m_datadirs; }
63
65 std::string Homedir() const { return m_home; }
66
67private:
69
70 void InitWindowsPaths();
71 void InitFlatpakPaths();
72 void InitLinuxPaths();
73 void InitApplePaths();
74 void InitAndroidPaths();
75
76 std::string m_home;
77 std::string m_user_datadir;
78 std::string m_user_bindir;
79 std::string m_userLibdir;
80 std::vector<std::string> m_libdirs;
81 std::vector<std::string> m_bindirs;
82 std::vector<std::string> m_datadirs;
83};
84#endif // MODEL__PLUGIN_PATHS_H
Accessors for various paths to install plugins and their data.
std::vector< std::string > Libdirs()
List of directories from which we load plugins.
std::string UserLibdir()
The single, user-writable directory for installing .dll files.
std::string Homedir() const
home directory, convenience stuff.
std::string UserDatadir()
The single, user-writable common parent for plugin data directories, typically ending in 'plugins'.
static PluginPaths * GetInstance()
Return the singleton instance.
std::vector< std::string > Bindirs()
'List of directories for plugin binary helpers.
std::string UserBindir()
The single, user-writable directory for installing helper binaries.
std::vector< std::string > Datadirs()
List of directories containing plugin data, each element typically ends in 'plugins'.
std::string join(std::vector< std::string > v, char c)
Join a list of directories to a string.