Bläddra i källkod

#IQRV #comment setAPI优化

80374374 1 år sedan
förälder
incheckning
b0e3419835
1 ändrade filer med 23 tillägg och 0 borttagningar
  1. 23 0
      Framework/spbase/sp_logwithlink.cpp

+ 23 - 0
Framework/spbase/sp_logwithlink.cpp

@@ -329,6 +329,29 @@ DbgWithLink& DbgWithLink::setLogCode(CSimpleStringA t_LogCode) {
 }
 
 DbgWithLink& DbgWithLink::setAPI(CSimpleStringA t_API) {
+
+#if defined(RVC_OS_WIN)
+	if (!t_API.IsNullOrEmpty() && t_API.IndexOf("::") != -1
+		&& !t_API.IsStartWith("DevAdapter::") /** treat specially  [Gifur@2024730]*/
+		) {
+		int tIdx = 0;
+		const int nLen = t_API.GetLength();
+		for (int i = nLen - 1; i > 0; --i) {
+			if (t_API[i] == ':' && t_API[i - 1] == ':') {
+				tIdx = i + 1;
+				break;
+			}
+		}
+		if (tIdx > 0 && tIdx < nLen) {
+			t_API = t_API.SubString(tIdx);
+		}
+		else if (tIdx == nLen) {
+			t_API.Clear();
+			t_API = CSimpleStringA(true);
+		}
+	}
+#endif //RVC_OS_WIN
+
     m_priPtr->API = t_API;
     return *this;
 }