-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathbase.h
More file actions
51 lines (40 loc) · 1.46 KB
/
base.h
File metadata and controls
51 lines (40 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// system includes
#include <filesystem>
#include <string>
// local includes
#include "linuxdeploy/log/log.h"
#include "linuxdeploy/plugin/plugin.h"
#pragma once
namespace linuxdeploy {
namespace plugin {
namespace base {
/*
* Base class for plugins.
*/
template<int API_LEVEL>
class PluginBase : public IPlugin {
private:
// private data class pattern
class PrivateData;
PrivateData* d;
public:
// default constructor
// construct Plugin from given path
explicit PluginBase(const std::filesystem::path& path);
~PluginBase() override;
public:
int apiLevel() const override;
// get path to plugin
std::filesystem::path path() const override;
// get plugin type
PLUGIN_TYPE pluginType() const override;
std::string pluginTypeString() const override;
// run plugin
int run(const std::filesystem::path& appDirPath) override;
};
}
}
}
// need to include implementation at the end of the file to solve issues like
// https://bytefreaks.net/programming-2/c/c-undefined-reference-to-templated-class-function
#include "linuxdeploy/plugin/base_impl.h"