|
@@ -149,6 +149,29 @@ static uint64_t get_timestamp_from_vec(const uint8_t* szData,const size_t size)
|
|
|
return timestamp;
|
|
|
}
|
|
|
|
|
|
+// 去掉字符串中的"${}"部分
|
|
|
+static std::string removeBraces(const std::string& input) {
|
|
|
+ std::string result;
|
|
|
+ size_t startPos = 0;
|
|
|
+ size_t foundPos = input.find("${", startPos); // 查找"${"的位置
|
|
|
+
|
|
|
+ while (foundPos != std::string::npos) {
|
|
|
+ // 将"${"之前的部分拼接到结果中
|
|
|
+ result += input.substr(startPos, foundPos - startPos);
|
|
|
+
|
|
|
+ // 更新起始位置,跳过"${"
|
|
|
+ startPos = foundPos + 2;
|
|
|
+
|
|
|
+ // 查找下一个"${"的位置
|
|
|
+ foundPos = input.find("${", startPos);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将最后一个"${"之后的部分拼接到结果中
|
|
|
+ result += input.substr(startPos);
|
|
|
+
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
//获取%{}中的数值
|
|
|
static std::vector<std::string> extractValueFromExpression(const std::string& expression)
|
|
|
{
|