MatN work for versatile appimage creation for all types of os
[goodguy/cinelerra.git] / cinelerra-5.1 / tools / makeappimagetool / includes / appdir_root_setup.h
diff --git a/cinelerra-5.1/tools/makeappimagetool/includes/appdir_root_setup.h b/cinelerra-5.1/tools/makeappimagetool/includes/appdir_root_setup.h
new file mode 100644 (file)
index 0000000..05fea32
--- /dev/null
@@ -0,0 +1,36 @@
+#pragma once
+
+// system headers
+#include <memory>
+
+// local headers
+#include "appdir.h"
+
+namespace linuxdeploy {
+    namespace core {
+        /**
+         * Wrapper for an AppDir that encapsulates all functionality to set up the AppDir root directory.
+         */
+        class AppDirRootSetup {
+        private:
+            // PImpl
+            class Private;
+            std::shared_ptr<Private> d;
+
+        public:
+            explicit AppDirRootSetup(const appdir::AppDir& appdir);
+
+            /**
+             * Deploy files to the AppDir root directory using the provided desktop file and the information within it.
+             * Optionally, a custom AppRun path can be provided which is deployed instead of following the internal
+             * default mechanism, which usually just places a symlink to the main binary as AppRun.
+             *
+             * @param desktopFile
+             * @param customAppRunPath
+             * @return
+             */
+            bool run(const desktopfile::DesktopFile& desktopFile, const boost::filesystem::path& customAppRunPath = "") const;
+        };
+
+    }
+}