MatN work for versatile appimage creation for all types of os
[goodguy/cinelerra.git] / cinelerra-5.1 / tools / makeappimagetool / includes / base.h
1 // system includes
2 #include <string>
3
4 // library includes
5 #include <boost/filesystem.hpp>
6
7 // local includes
8 #include "log.h"
9 #include "plugin.h"
10
11 #pragma once
12
13 namespace linuxdeploy {
14     namespace plugin {
15         namespace base {
16             /*
17              * Base class for plugins.
18              */
19             template<int API_LEVEL>
20             class PluginBase : public IPlugin {
21                 private:
22                     // private data class pattern
23                     class PrivateData;
24
25                     PrivateData* d;
26
27                 public:
28                     // default constructor
29                     // construct Plugin from given path
30                     explicit PluginBase(const boost::filesystem::path& path);
31
32                     ~PluginBase() override;
33
34                 public:
35                     int apiLevel() const override;
36
37                     // get path to plugin
38                     boost::filesystem::path path() const override;
39
40                     // get plugin type
41                     PLUGIN_TYPE pluginType() const override;
42                     std::string pluginTypeString() const override;
43
44                     // run plugin
45                     int run(const boost::filesystem::path& appDirPath) override;
46             };
47         }
48     }
49 }
50
51 // need to include implementation at the end of the file to solve issues like
52 // https://bytefreaks.net/programming-2/c/c-undefined-reference-to-templated-class-function
53 #include "base_impl.h"