Files
checker_host/base/base.cpp
ranchuan 2451c5dfc5 自研批检仪检测命令测试成功
广播方式升级从机发现卡死现象
2023-12-04 18:15:37 +08:00

34 lines
565 B
C++

#include "base/base.h"
#include "QList"
// 字符串转化为数字列表
//template <typename T>
//QList<T> str_to_nums(mystring str, char c)
//{
// QStringList snums = str.split(c);
// QList<T> nums;
// for (int i = 0; i < snums.size(); i++)
// nums.append(T(snums[i].toInt(nullptr, 10)));
// return nums;
//}
// 字符串转化为数组
myarray str_to_data(mystring str, char c)
{
QStringList snums = str.split(c);
myarray d;
for (int i = 0; i < snums.size(); i++)
{
d.append(uint8_t(snums[i].toInt(nullptr, 10)));
}
return d;
}