From 5373d256e77414acb8872443f536002215bf674a Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=B5=9C=EC=A2=85=ED=97=8C/Common=20Platform=20Lab=28SR=29?= =?utf8?q?/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 11 Jun 2020 10:11:57 +0900 Subject: [PATCH] Modified to pass the argument by constant reference (#242) Change-Id: I32016827498c178c7e29224cecb465a605731804 --- NativeLauncher/inc/tac_common.h | 2 +- NativeLauncher/inc/utils.h | 8 ++++---- NativeLauncher/tool/tac_common.cc | 2 +- NativeLauncher/util/utils.cc | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) 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; -- 2.7.4