负责字符串和数字的转化 更多...
#include <sttnet.h>
静态 Public 成员函数 | |
| static int & | toInt (const std::string_view &ori_str, int &result, const int &i=-1) |
| string转化为int类型 更多... | |
| static int & | str16toInt (const std::string_view &ori_str, int &result, const int &i=-1) |
| 16进制数字的字符串表示转化为10进制int类型数字 更多... | |
| static long & | toLong (const std::string_view &ori_str, long &result, const long &i=-1) |
| string转化为long类型 更多... | |
| static float & | toFloat (const std::string &ori_str, float &result, const float &i=-1) |
| string转化为float类型 更多... | |
| static double & | toDouble (const std::string &ori_str, double &result, const double &i=-1) |
| string转化为double类型 更多... | |
| static bool & | toBool (const std::string_view &ori_str, bool &result) |
| string转化为bool类型 更多... | |
| static std::string & | strto16 (const std::string &ori_str, std::string &result) |
| 将普通字符串转化为对应的十六进制表示字符串(hex string)。 更多... | |
负责字符串和数字的转化
|
static |
16进制数字的字符串表示转化为10进制int类型数字
| ori_str | 16进制数字的字符串表示 |
| result | 保存转化结果的int容器 |
|
static |
将普通字符串转化为对应的十六进制表示字符串(hex string)。
例如输入 "ABC" 会被转化为 "414243",每个字符转换为其 ASCII 的十六进制形式。
| ori_str | 输入的原始字符串(可以包含任意字符,包括不可见字符)。 |
| result | 存放转换后结果的字符串引用。 |
|
static |
string转化为bool类型
| ori_str | 原始string类型数据 |
| result | 存放结果的bool容器 |
|
static |
string转化为double类型
| ori_str | 原始string类型数据 |
| result | 存放结果的double容器 |
| i | 如果转化失败 则把result赋值为i(默认为-1) |
|
static |
string转化为float类型
| ori_str | 原始string类型数据 |
| result | 存放结果的float容器 |
| i | 如果转化失败 则把result赋值为i(默认为-1) |
|
static |
string转化为int类型
| ori_str | 原始string类型数据 |
| result | 存放结果的int容器 |
| i | 如果转化失败 则把result赋值为i(默认为-1) |
|
static |
string转化为long类型
| ori_str | 原始string类型数据 |
| result | 存放结果的long容器 |
| i | 如果转化失败 则把result赋值为i(默认为-1) |
1.8.5