From 3e3ddf8d3e41f4448033c96927da602131090ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E5=B0=8F=E6=9E=97?= Date: Sat, 6 Sep 2025 11:53:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E5=87=BD=E6=95=B0CommonFunc::Decode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie485015ac98ebd189e2ee55ce85abc310313df67 Signed-off-by: 姜小林 --- interfaces/kits/js/src/mod_fs/common_func.cpp | 21 ------------------- interfaces/kits/js/src/mod_fs/common_func.h | 1 - 2 files changed, 22 deletions(-) diff --git a/interfaces/kits/js/src/mod_fs/common_func.cpp b/interfaces/kits/js/src/mod_fs/common_func.cpp index 3b10d60e2..c1d41a3c2 100644 --- a/interfaces/kits/js/src/mod_fs/common_func.cpp +++ b/interfaces/kits/js/src/mod_fs/common_func.cpp @@ -368,27 +368,6 @@ string CommonFunc::GetModeFromFlags(unsigned int flags) return mode; } -string CommonFunc::Decode(const std::string &uri) -{ - std::ostringstream outPutStream; - const int32_t encodeLen = 2; - size_t index = 0; - while (index < uri.length()) { - if (uri[index] == '%') { - int hex = 0; - std::istringstream inputStream(uri.substr(index + 1, encodeLen)); - inputStream >> std::hex >> hex; - outPutStream << static_cast(hex); - index += encodeLen + 1; - } else { - outPutStream << uri[index]; - index++; - } - } - - return outPutStream.str(); -} - #if !defined(WIN_PLATFORM) && !defined(IOS_PLATFORM) && !defined(CROSS_PLATFORM) bool IsNumeric(const string &str) { diff --git a/interfaces/kits/js/src/mod_fs/common_func.h b/interfaces/kits/js/src/mod_fs/common_func.h index d536abaae..2f01f5762 100644 --- a/interfaces/kits/js/src/mod_fs/common_func.h +++ b/interfaces/kits/js/src/mod_fs/common_func.h @@ -106,7 +106,6 @@ struct CommonFunc { napi_value dstPath); static void fs_req_cleanup(uv_fs_t* req); static std::string GetModeFromFlags(unsigned int flags); - static std::string Decode(const std::string &uri); #if !defined(WIN_PLATFORM) && !defined(IOS_PLATFORM) && !defined(CROSS_PLATFORM) static bool GetAndCheckUserId(Uri* uri, std::string &userId); static bool IsSystemApp(); -- Gitee