From 1bc4fecb9cc1641ed3ad0a2fda30766fc06fb13e Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期二, 01 四月 2025 16:05:07 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang
---
SourceCode/Bond/Servo/ToolUnits.cpp | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/SourceCode/Bond/Servo/ToolUnits.cpp b/SourceCode/Bond/Servo/ToolUnits.cpp
index 664f802..b32362a 100644
--- a/SourceCode/Bond/Servo/ToolUnits.cpp
+++ b/SourceCode/Bond/Servo/ToolUnits.cpp
@@ -2,6 +2,7 @@
#include "ToolUnits.h"
#include <chrono>
#include <memory>
+#include <sstream>
CToolUnits::CToolUnits()
@@ -301,4 +302,18 @@
ltm.tm_hour, ltm.tm_min, ltm.tm_sec);
return std::string(buffer);
+}
+
+bool CToolUnits::startsWith(const std::string& str, const std::string& prefix)
+{
+ return str.size() >= prefix.size() && str.compare(0, prefix.size(), prefix) == 0;
+}
+
+std::string& CToolUnits::toHexString(int value, std::string& strOut)
+{
+ std::stringstream ss;
+ ss << std::hex << value;
+ strOut = ss.str();
+
+ return strOut;
}
\ No newline at end of file
--
Gitblit v1.9.3