stroll校验endptr

Signed-off-by: liduo <liduo29@huawei.com>
This commit is contained in:
liduo
2026-05-15 11:19:04 +08:00
parent 0e75fb4b63
commit 404dbff205
6 changed files with 71 additions and 7 deletions
+1
View File
@@ -59,6 +59,7 @@ const static int8_t INVALID_ID = -1;
const static int MIN_SUPPORT_NEW_MODULE_API_VERSION = 20;
const static int MIN_SUPPORT_TS_HEADER_API_VERSION = 23;
const static int API_VERSION_DIVISOR = 1000;
const static int HEX_BASE = 16;
enum class IgnoreType {
IGNORE_FILE,
+18
View File
@@ -299,6 +299,24 @@ public:
*/
static bool IsHarResource(int64_t id);
/**
* @brief Convert string to int
* @param str: input string
* @param value: output int value
* @param base: conversion base, default 10
* @return true if success, other false
*/
static bool StrToInt(const std::string &str, int &value, int base = 10);
/**
* @brief Convert string to long long
* @param str: input string
* @param value: output long long value
* @param base: conversion base, default 10
* @return true if success, other false
*/
static bool StrToLongLong(const std::string &str, long long &value, int base = 10);
private:
static const std::map<std::string, IgnoreType> DEFAULT_IGNORE_FILE_REGEX;
static std::string GetLocaleLimitkey(const KeyParam &KeyParam);