Modified to pass the argument by constant reference (#242)
author최종헌/Common Platform Lab(SR)/Engineer/삼성전자 <j-h.choi@samsung.com>
Thu, 11 Jun 2020 01:11:57 +0000 (10:11 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Thu, 11 Jun 2020 01:11:57 +0000 (10:11 +0900)
Change-Id: I32016827498c178c7e29224cecb465a605731804

NativeLauncher/inc/tac_common.h
NativeLauncher/inc/utils.h
NativeLauncher/tool/tac_common.cc
NativeLauncher/util/utils.cc

index 88d4bd5..990164e 100644 (file)
@@ -67,6 +67,6 @@ tac_error_e enableTACPackage(const std::string& pkgId);
  * @param[in] tpa list
  * @return std::vector<std::string> parser data
  */
-std::vector<std::string> depsJsonParser(std::string rootPath, std::string execName, std::string tpaList);
+std::vector<std::string> depsJsonParser(const std::string& rootPath, const std::string& execName, const std::string& tpaList);
 
 #endif /* __TAC_COMMON_H__ */
index ff06fa5..a25c62c 100644 (file)
@@ -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
index eba7c17..a5e0a02 100644 (file)
@@ -390,7 +390,7 @@ tac_error_e enableTACPackage(const std::string& pkgId)
 }
 
 //Parser the .deps.json file to get nuget information.
-std::vector<std::string> depsJsonParser(std::string rootPath, std::string execName, std::string tpaList)
+std::vector<std::string> depsJsonParser(const std::string& rootPath, const std::string& execName, const std::string& tpaList)
 {
        std::vector<std::string> tpaAssemblies;
        splitPath(tpaList, tpaAssemblies);
index 22df38b..f399b2c 100644 (file)
@@ -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;