|
|
@ -46,6 +46,21 @@ class StringUtil { |
|
|
|
* @return false 转换失败 |
|
|
|
*/ |
|
|
|
bool hexStringToBytes(string in, string delims, vector<uint8_t>& byteTable); |
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief |
|
|
|
* |
|
|
|
* @param value 0x55 |
|
|
|
* @param bitCount 8 |
|
|
|
* @param remoteZero true/false |
|
|
|
* @return string 01010101 |
|
|
|
* |
|
|
|
* Demo: |
|
|
|
* StringUtil::bytet2Binary(0x55,8,true) ===> 1010101 |
|
|
|
* StringUtil::bytet2Binary(0x55,8,false) ===> 01010101 |
|
|
|
* |
|
|
|
*/ |
|
|
|
string bytet2Binary(uint32_t value, int bitCount, bool remoteZero = true); |
|
|
|
}; |
|
|
|
|
|
|
|
} // namespace core
|
|
|
|