From: 최종헌/Common Platform Lab(SR)/Engineer/삼성전자 Date: Thu, 11 Jun 2020 01:11:57 +0000 (+0900) Subject: Modified to pass the argument by constant reference (#242) X-Git-Tag: submit/tizen/20200622.225420~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5373d256e77414acb8872443f536002215bf674a;p=platform%2Fcore%2Fdotnet%2Flauncher.git Modified to pass the argument by constant reference (#242) Change-Id: I32016827498c178c7e29224cecb465a605731804 --- diff --git a/NativeLauncher/inc/tac_common.h b/NativeLauncher/inc/tac_common.h index 88d4bd5..990164e 100644 --- a/NativeLauncher/inc/tac_common.h +++ b/NativeLauncher/inc/tac_common.h @@ -67,6 +67,6 @@ tac_error_e enableTACPackage(const std::string& pkgId); * @param[in] tpa list * @return std::vector parser data */ -std::vector depsJsonParser(std::string rootPath, std::string execName, std::string tpaList); +std::vector depsJsonParser(const std::string& rootPath, const std::string& execName, const std::string& tpaList); #endif /* __TAC_COMMON_H__ */ diff --git a/NativeLauncher/inc/utils.h b/NativeLauncher/inc/utils.h index ff06fa5..a25c62c 100644 --- a/NativeLauncher/inc/utils.h +++ b/NativeLauncher/inc/utils.h @@ -82,21 +82,21 @@ std::string getBaseName(const std::string& path); * @param[in] replacement string * return the modified string */ -std::string replaceAll(const std::string &str, const std::string &pattern, const std::string &replace); +std::string replaceAll(const std::string& str, const std::string& pattern, const std::string& replace); /** * @brief get root path * @param[in] package id * @param[out] root path */ -int getRootPath(std::string pkgId, std::string& rootPath); +int getRootPath(const std::string& pkgId, std::string& rootPath); /** * @brief get exec name * @param[in] package id * @param[out] exec name */ -int getExecName(std::string pkgId, std::string& execName); +int getExecName(const std::string& pkgId, std::string& execName); /** * @brief get metadata value @@ -104,7 +104,7 @@ int getExecName(std::string pkgId, std::string& execName); * @param[in] metadata key * @param[out] metadata value */ -int getMetadataValue(std::string pkgId, std::string metadataKey, std::string& metadataValue); +int getMetadataValue(const std::string& pkgId, const std::string& metadataKey, std::string& metadataValue); /** * @brief split path with ":" delimiter and put that in the vector diff --git a/NativeLauncher/tool/tac_common.cc b/NativeLauncher/tool/tac_common.cc index eba7c17..a5e0a02 100644 --- a/NativeLauncher/tool/tac_common.cc +++ b/NativeLauncher/tool/tac_common.cc @@ -390,7 +390,7 @@ tac_error_e enableTACPackage(const std::string& pkgId) } //Parser the .deps.json file to get nuget information. -std::vector depsJsonParser(std::string rootPath, std::string execName, std::string tpaList) +std::vector depsJsonParser(const std::string& rootPath, const std::string& execName, const std::string& tpaList) { std::vector tpaAssemblies; splitPath(tpaList, tpaAssemblies); diff --git a/NativeLauncher/util/utils.cc b/NativeLauncher/util/utils.cc index 22df38b..f399b2c 100644 --- a/NativeLauncher/util/utils.cc +++ b/NativeLauncher/util/utils.cc @@ -112,7 +112,7 @@ std::string getAbsolutePath(const std::string& path) return absPath; } -int getRootPath(std::string pkgId, std::string& rootPath) +int getRootPath(const std::string& pkgId, std::string& rootPath) { int ret = 0; char *path = 0; @@ -146,7 +146,7 @@ int getRootPath(std::string pkgId, std::string& rootPath) return 0; } -int getExecName(std::string pkgId, std::string& execName) +int getExecName(const std::string& pkgId, std::string& execName) { char *exec = NULL; char *appId = 0; @@ -181,7 +181,7 @@ int getExecName(std::string pkgId, std::string& execName) return 0; } -int getMetadataValue(std::string pkgId, std::string metadataKey, std::string& metadataValue) +int getMetadataValue(const std::string& pkgId, const std::string& metadataKey, std::string& metadataValue) { char *value = NULL; char *appId = 0; @@ -227,7 +227,7 @@ std::string getBaseName(const std::string& path) return path; } -std::string replaceAll(const std::string &str, const std::string &pattern, const std::string &replace) +std::string replaceAll(const std::string& str, const std::string& pattern, const std::string& replace) { std::string result = str; std::string::size_type pos = 0;