#include <common/installer_runner.h>
#include <common/pkgmgr_interface.h>
#include <cerrno>
+#include <memory>
#include "hybrid/hybrid_installer.h"
#include "hybrid/hybrid_installer_factory.h"
namespace ci = common_installer;
-#if __cplusplus < 201300L
-namespace {
-
-template<typename T, typename... Args>
-std::unique_ptr<T> make_unique(Args&&... args) {
- return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
-}
-
-} // namespace
-#endif
-
int main(int argc, char** argv) {
ci::PkgmgrInstaller pkgmgr_installer;
std::shared_ptr<wgt::WgtAppQueryInterface> query_interface(
return EINVAL;
}
-#if __cplusplus >= 201300L
- using std;
-#endif
// This is workaround for hybrid apps as they requires much different flow
// but installer does not branch at all in current design
if (query_interface->IsHybridApplication(
pkgmgr->GetRequestInfo(), pkgmgr->GetUid())) {
LOG(INFO) << "Hybrid package detected";
ci::InstallerRunner runner(
- make_unique<hybrid::HybridInstallerFactory>(), pkgmgr);
+ std::make_unique<hybrid::HybridInstallerFactory>(), pkgmgr);
return (runner.Run() == ci::AppInstaller::Result::OK) ? 0 : 1;
} else {
ci::InstallerRunner runner(
- make_unique<wgt::WgtInstallerFactory>(), pkgmgr);
+ std::make_unique<wgt::WgtInstallerFactory>(), pkgmgr);
return (runner.Run() == ci::AppInstaller::Result::OK) ? 0 : 1;
}
} catch(...) {