From cfeb9180333e3c16b05bf1f0d553894eda46c2d6 Mon Sep 17 00:00:00 2001 From: shenweip Date: Mon, 18 Nov 2013 23:45:44 +0800 Subject: [PATCH 1/2] Add strcmpIgnore func. --- base/stringutil.cpp | 6 ++++++ base/stringutil.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/base/stringutil.cpp b/base/stringutil.cpp index 414fe117c9..c1d5ed35e6 100644 --- a/base/stringutil.cpp +++ b/base/stringutil.cpp @@ -233,4 +233,10 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st pos += dest.size(); } return result; +} + +int strcmpIgnore(std::string str1, std::string str2, std::string ignorestr1, std::string ignorestr2) { + str1 = ReplaceAll(str1, ignorestr1, ignorestr2); + str2 = ReplaceAll(str2, ignorestr1, ignorestr2); + return strcmp(str1.c_str(),str2.c_str()); } \ No newline at end of file diff --git a/base/stringutil.h b/base/stringutil.h index 97fc6051ae..c94638c640 100644 --- a/base/stringutil.h +++ b/base/stringutil.h @@ -133,6 +133,8 @@ void SplitString(const std::string& str, const char delim, std::vector static std::string ValueToString(const N value) { From 9bf31c9ad5d82b4818fff71d7695fefef154b920 Mon Sep 17 00:00:00 2001 From: shenweip Date: Tue, 19 Nov 2013 00:33:18 +0800 Subject: [PATCH 2/2] Add a comment. --- base/stringutil.h | 1 + 1 file changed, 1 insertion(+) diff --git a/base/stringutil.h b/base/stringutil.h index c94638c640..3cd9a9f3d4 100644 --- a/base/stringutil.h +++ b/base/stringutil.h @@ -133,6 +133,7 @@ void SplitString(const std::string& str, const char delim, std::vector