From 3fd595a63b79dccfc8202409d6b43ebff73e1339 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Wed, 14 Aug 2019 01:33:09 +0200 Subject: [PATCH] Expose file copying helper in public interface --- include/linuxdeploy/core/appdir.h | 3 +++ src/core/appdir.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/include/linuxdeploy/core/appdir.h b/include/linuxdeploy/core/appdir.h index d703fc5..804e528 100644 --- a/include/linuxdeploy/core/appdir.h +++ b/include/linuxdeploy/core/appdir.h @@ -66,6 +66,9 @@ namespace linuxdeploy { // deploy arbitrary file boost::filesystem::path deployFile(const boost::filesystem::path& from, const boost::filesystem::path& to); + // copy arbitrary file (immediately) + bool copyFile(const boost::filesystem::path& from, const boost::filesystem::path& to, bool overwrite = false) const; + // create an relative symlink to at . bool createRelativeSymlink(const boost::filesystem::path& target, const boost::filesystem::path& symlink) const; diff --git a/src/core/appdir.cpp b/src/core/appdir.cpp index ea53921..a66baa5 100644 --- a/src/core/appdir.cpp +++ b/src/core/appdir.cpp @@ -824,6 +824,10 @@ namespace linuxdeploy { return d->deployFile(from, to, true); } + bool AppDir::copyFile(const bf::path& from, const bf::path& to, bool overwrite) const { + return d->copyFile(from, to, overwrite); + } + bool AppDir::createRelativeSymlink(const bf::path& target, const bf::path& symlink) const { return d->symlinkFile(target, symlink, true); }