From: Cho Woong Suk Date: Thu, 26 Apr 2018 05:22:53 +0000 (+0900) Subject: support multiple dll path for plugin X-Git-Tag: accepted/tizen/unified/20180427.062348~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ccd908d08d80c2204ac0e6a1b25b2dad864525a;p=platform%2Fcore%2Fdotnet%2Flauncher.git support multiple dll path for plugin Change-Id: Ia528f3c2daab56c7b03ca4f679028545bf62ce21 --- diff --git a/NativeLauncher/inc/utils.h b/NativeLauncher/inc/utils.h index ac3816e..18fdaa0 100644 --- a/NativeLauncher/inc/utils.h +++ b/NativeLauncher/inc/utils.h @@ -32,6 +32,7 @@ bool isManagedAssembly(const std::string& fileName); bool isNativeImage(const std::string& fileName); std::string readSelfPath(); std::string concatPath(const std::string& path1, const std::string& path2); +void splitPath(const std::string& path, std::vector& out); void appendPath(std::string& path1, const std::string& path2); std::string absolutePath(const std::string& path); std::string baseName(const std::string& path); diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc index cc511ab..10c36cd 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc @@ -223,7 +223,7 @@ int CoreRuntime::initialize(bool standalone) if (pluginGetDllPath) { std::string pluginPath = pluginGetDllPath(); if (!pluginPath.empty()) { - searchDirectories.push_back(pluginPath); + splitPath(pluginPath, searchDirectories); } } diff --git a/NativeLauncher/util/utils.cc b/NativeLauncher/util/utils.cc index 3d14f00..4016ac5 100644 --- a/NativeLauncher/util/utils.cc +++ b/NativeLauncher/util/utils.cc @@ -88,6 +88,16 @@ std::string concatPath(const std::string& path1, const std::string& path2) return path; } +void splitPath(const std::string& path, std::vector& out) +{ + std::istringstream ss(path); + std::string token; + + while (std::getline(ss, token, ':')) { + out.push_back(token); + } +} + void appendPath(std::string& path1, const std::string& path2) { if (path1.back() == PATH_SEPARATOR) {