Home
last modified time | relevance | path

Searched refs:str (Results 1 – 25 of 687) sorted by relevance

12345678910>>...28

/base/hiviewdfx/hilog_lite/frameworks/js/builtin/src/
Dhilog_string.cpp24 HilogString::HilogString() : size(0), maxSize(0), str(nullptr) {} in HilogString()
30 if (str != nullptr) { in ~HilogString()
31 free(str); in ~HilogString()
32 str = nullptr; in ~HilogString()
36 char *HilogString::Get(const HilogString *str) in Get() argument
38 if (str != nullptr) { in Get()
39 return str->str; in Get()
44 size_t HilogString::Length(const HilogString *str) in Length() argument
46 if (str != nullptr) { in Length()
47 return str->size; in Length()
[all …]
Dhilog_vector.cpp25 HilogVector::HilogVector() : size(0), maxSize(0), str(nullptr), type(nullptr) {} in HilogVector()
29 if (str != nullptr) { in ~HilogVector()
31 char *tmp = str[i]; in ~HilogVector()
36 free(str); in ~HilogVector()
37 str = nullptr; in ~HilogVector()
56 if (vector != nullptr && vector->str != nullptr && pos < vector->size) { in GetStr()
57 return vector->str[pos]; in GetStr()
78 …HilogRealloc::Realloc(vector->str, sizeof(char*) * vector->maxSize, sizeof(char*) * vector->size)); in Push()
83 vector->str = tempStr; in Push()
89 if (vector->str != nullptr && vector->type != nullptr) { in Push()
[all …]
/base/print/print_fwk/utils/include/
Dprint_util.h33 static std::string SplitStr(const std::string& str, char delimiter, int index);
35 static std::string ToUpper(const std::string& str);
37 static bool CheckContains(const std::string& str, const std::string& content);
42 std::string str; in ParseListToString() local
47 str += val; in ParseListToString()
49 str += ","; in ParseListToString()
54 return str; in ParseListToString()
57 inline std::string PrintUtil::SplitStr(const std::string& str, char delimiter, int index) in SplitStr() argument
59 if (!str.empty()) { in SplitStr()
61 std::istringstream tokenStream(str); in SplitStr()
[all …]
/base/security/device_auth/common_lib/impl/src/
Dhc_string.c30 HcBool StringAppend(HcString *self, HcString str) in StringAppend() argument
32 uint32_t length = GetParcelDataSize(&str.parcel); in StringAppend()
37 return StringAppendPointer(self, GetParcelData(&str.parcel)); in StringAppend()
50 HcBool StringAppendPointer(HcString *self, const char *str) in StringAppendPointer() argument
52 if (self != NULL && str != NULL) { in StringAppendPointer()
56 return ParcelWrite(&self->parcel, (void *)str, strlen(str) + 1); in StringAppendPointer()
90 HcBool StringSet(HcString *self, HcString str) in StringSet() argument
94 return StringAppend(self, str); in StringSet()
107 HcBool StringSetPointer(HcString *self, const char *str) in StringSetPointer() argument
111 return StringAppendPointer(self, str); in StringSetPointer()
[all …]
/base/notification/distributed_notification_service/services/distributed/test/unittest/mock/
Dmock_blob.cpp59 Blob::Blob(const char *str, size_t n) : blob_() in Blob() argument
61 if (str != nullptr) { in Blob()
62 blob_ = std::vector<uint8_t>(str, str + n); in Blob()
66 Blob::Blob(const std::string &str) : blob_(str.begin(), str.end()) in Blob() argument
69 Blob::Blob(const char *str) : blob_() in Blob() argument
71 if (str != nullptr) { in Blob()
72 blob_ = std::vector<uint8_t>(str, str + strlen(str)); in Blob()
89 std::string str(blob_.begin(), blob_.end()); in ToString() local
90 return str; in ToString()
/base/hiviewdfx/hidumper/frameworks/native/src/util/
Dstring_utils.cpp66 void StringUtils::ReplaceAll(string &str, const string &oldValue, const string &newValue) in ReplaceAll() argument
68 str = ReplaceStr(str, oldValue, newValue); in ReplaceAll()
71 bool StringUtils::IsNum(string str) in IsNum() argument
73 return IsNumericStr(str); in IsNum()
76 bool StringUtils::Compare(const string &str, const vector<string> &strs) in Compare() argument
80 if (str == tempStr) { in Compare()
87 void StringUtils::HexToDec(const string &str, uint64_t &value) in HexToDec() argument
89 size_t l = str.length(); in HexToDec()
91 if (str[i] >= '0' && str[i] <= '9') in HexToDec()
92 value += (str[i] - '0') * pow(HEX_STR, l - 1 - i); in HexToDec()
[all …]
/base/global/resource_management_lite/frameworks/resmgr_lite/test/unittest/lite/common/
Dres_desc_test.cpp68 std::string str; variable
71 str.assign("abc");
72 EXPECT_TRUE(!IdItem::IsRef(str, resType, id));
74 str.assign("$abc");
75 EXPECT_TRUE(!IdItem::IsRef(str, resType, id));
77 str.assign("$abc:");
78 EXPECT_TRUE(!IdItem::IsRef(str, resType, id));
80 str.assign("$abc:abc");
81 EXPECT_TRUE(!IdItem::IsRef(str, resType, id));
83 str.assign("$abc:123456");
[all …]
/base/security/crypto_framework/common/src/
Dhcf_string.c32 bool StringAppendPointer(HcString *self, const char *str) in StringAppendPointer() argument
34 if (self != NULL && str != NULL) { in StringAppendPointer()
38 return ParcelWrite(&self->parcel, (void *)str, strlen(str) + 1); in StringAppendPointer()
51 bool StringSetPointer(HcString *self, const char *str) in StringSetPointer() argument
55 return StringAppendPointer(self, str); in StringSetPointer()
69 bool StringSetPointerWithLength(HcString* self, const char *str, uint32_t len) in StringSetPointerWithLength() argument
71 if (self == NULL || str == NULL) { in StringSetPointerWithLength()
74 uint32_t strLen = strlen(str); in StringSetPointerWithLength()
80 if (false == ParcelWrite(&self->parcel, str, len)) { in StringSetPointerWithLength()
214 HcString str; in CreateString() local
[all …]
/base/global/resource_management/frameworks/resmgr/test/unittest/common/
Dres_desc_test.cpp68 std::string str; variable
71 str.assign("abc");
72 EXPECT_TRUE(!IdItem::IsRef(str, resType, id));
74 str.assign("$abc");
75 EXPECT_TRUE(!IdItem::IsRef(str, resType, id));
77 str.assign("$abc:");
78 EXPECT_TRUE(!IdItem::IsRef(str, resType, id));
80 str.assign("$abc:abc");
81 EXPECT_TRUE(!IdItem::IsRef(str, resType, id));
83 str.assign("$abc:123456");
[all …]
/base/powermgr/thermal_manager/utils/native/src/
Dstring_operation.cpp28 void StringOperation::SplitString(const std::string& str, std::vector<std::string>& ret, const std:… in SplitString() argument
30 ClearAllSpace(str); in SplitString()
31 if (str.empty()) { in SplitString()
36 std::string::size_type begin = str.find_first_not_of(sep); in SplitString()
38 std::string::size_type pos = str.find(sep, begin); in SplitString()
40 temp = str.substr(begin, pos - begin); in SplitString()
43 temp = str.substr(begin); in SplitString()
82 bool StringOperation::StrToUint(const std::string& str, uint32_t& value) in StrToUint() argument
84 if (str.empty() || (!isdigit(str.front()) && (str.front() != '-'))) { in StrToUint()
90 auto addr = str.c_str(); in StrToUint()
[all …]
/base/update/updater/test/unittest/utils/json/
Dutils_json_test.cpp56 std::string str = R"({"key": "value1"})"; variable
57 JsonNode node(str);
62 std::string str = R"({"key"})"; variable
63 JsonNode node(str);
70 std::string str = R"({"key": "value1"})"; variable
71 JsonNode node(str);
77 std::string str = R"({"key": "value1"})"; variable
78 JsonNode node(str);
85 std::string str = R"({"key": 1})"; variable
86 JsonNode node(str);
[all …]
/base/startup/init/test/moduletest/
Dtest_utils.cpp61 bool StartsWith(const std::string &str, const std::string &prefix) in StartsWith() argument
63 return ((str.size() > prefix.size()) && (str.substr(0, prefix.size()) == prefix)); in StartsWith()
66 bool EndsWith(const std::string &str, const std::string &suffix) in EndsWith() argument
68 …return ((str.size() > suffix.size()) && (str.substr(str.size() - suffix.size(), suffix.size()) == … in EndsWith()
71 std::string Trim(const std::string &str) in Trim() argument
74 size_t end = str.size() - 1; in Trim()
76 while (start < str.size()) { in Trim()
77 if (!isspace(str[start])) { in Trim()
84 if (!isspace(str[end])) { in Trim()
94 return str.substr(start, end - start + 1); in Trim()
[all …]
/base/request/request/services/service/rust/src/
Dsys_event.rs29 const DOMAIN: &str = "REQUEST";
31 pub(crate) const ERROR_INFO: &str = "ERROR_INFO";
32 pub(crate) const TASKS_TYPE: &str = "TASKS_TYPE";
33 pub(crate) const TOTAL_FILE_NUM: &str = "TOTAL_FILE_NUM";
34 pub(crate) const FAIL_FILE_NUM: &str = "FAIL_FILE_NUM";
35 pub(crate) const SUCCESS_FILE_NUM: &str = "SUCCESS_FILE_NUM";
74 const TASK_FAULT: &str = "TASK_FAULT";
75 const TASK_INFO_STATISTICS: &str = "TASK_INFO_STATISTICS";
77 fn as_str(&self) -> &str { in as_str() argument
/base/hiviewdfx/hilog/frameworks/libhilog/utils/
Dlog_utils.cpp58 string str; in Size2Str() local
72 str = to_string(size); in Size2Str()
74 str = buf; in Size2Str()
76 return str + g_SizeMap.GetKey(unit); in Size2Str()
79 uint64_t Str2Size(const string& str) in Str2Size() argument
82 if (!std::regex_match(str, reg)) { in Str2Size()
85 uint64_t index = str.size() - 1; in Str2Size()
86 uint64_t unit = g_SizeMap.GetValue(str[index]); in Str2Size()
88 uint64_t value = stoull(str.substr(0, unit !=0 ? index : index + 1)); in Str2Size()
160 uint16_t Str2LogType(const string& str) in Str2LogType() argument
[all …]
/base/usb/usb_manager/test/native/js_unittest/
DDateAndTimeUtil.js82 transform24(str) { argument
83 const timeFlag = str.substr(0, 2);
85 const h = str.substr(2).split(':')[0];
87 const time = '0' + ':' + str.substr(2).split(':')[1];
90 return h + ':' + str.substr(2).split(':')[1];
93 const h = str.substr(2).split(':')[0];
96 const time = h1 + ':' + str.substr(2).split(':')[1];
107 transform12(str) { argument
108 const hours = str.substring(0, str.indexOf(':'));
109 const minutes = str.split(':')[1];
/base/telephony/sms_mms/utils/
Dstring_utils.cpp61 return ss.str(); in StringToHex()
71 return ss.str(); in StringToHex()
81 return ss.str(); in StringToHex()
84 std::string StringUtils::HexToString(const std::string &str) in HexToString() argument
89 if (str.length() <= 0) { in HexToString()
92 for (size_t i = 0; i < str.length() - 1; i += STEP_2BIT) { in HexToString()
93 std::string byte = str.substr(i, hexStep); in HexToString()
104 std::vector<uint8_t> StringUtils::HexToByteVector(const std::string &str) in HexToByteVector() argument
107 int sz = static_cast<int>(str.length()); in HexToByteVector()
112 …auto temp = static_cast<uint8_t>((HexCharToInt(str.at(i)) << HEX_OFFSET) | HexCharToInt(str.at(i +… in HexToByteVector()
[all …]
/base/notification/distributed_notification_service/services/test/moduletest/mock/
Dblob.cpp59 Blob::Blob(const char *str, size_t n) in Blob() argument
62 if (str != nullptr) { in Blob()
63 blob_ = std::vector<uint8_t>(str, str + n); in Blob()
67 Blob::Blob(const std::string &str) in Blob() argument
68 : blob_(str.begin(), str.end()) in Blob()
72 Blob::Blob(const char *str) in Blob() argument
75 if (str != nullptr) { in Blob()
76 blob_ = std::vector<uint8_t>(str, str + strlen(str)); in Blob()
130 std::string str(blob_.begin(), blob_.end()); in ToString() local
131 return str; in ToString()
/base/notification/distributed_notification_service/services/ans/test/unittest/mock/
Dblob.cpp59 Blob::Blob(const char *str, size_t n) in Blob() argument
62 if (str != nullptr) { in Blob()
63 blob_ = std::vector<uint8_t>(str, str + n); in Blob()
67 Blob::Blob(const std::string &str) in Blob() argument
68 : blob_(str.begin(), str.end()) in Blob()
72 Blob::Blob(const char *str) in Blob() argument
75 if (str != nullptr) { in Blob()
76 blob_ = std::vector<uint8_t>(str, str + strlen(str)); in Blob()
130 std::string str(blob_.begin(), blob_.end()); in ToString() local
131 return str; in ToString()
/base/notification/distributed_notification_service/frameworks/test/moduletest/mock/
Dblob.cpp59 Blob::Blob(const char *str, size_t n) in Blob() argument
62 if (str != nullptr) { in Blob()
63 blob_ = std::vector<uint8_t>(str, str + n); in Blob()
67 Blob::Blob(const std::string &str) in Blob() argument
68 : blob_(str.begin(), str.end()) in Blob()
72 Blob::Blob(const char *str) in Blob() argument
75 if (str != nullptr) { in Blob()
76 blob_ = std::vector<uint8_t>(str, str + strlen(str)); in Blob()
130 std::string str(blob_.begin(), blob_.end()); in ToString() local
131 return str; in ToString()
/base/powermgr/thermal_manager/test/unittest/src/
Dthermal_utils_test.cpp69 std::string str; variable
72 StringOperation::SplitString(str, ret, sep);
73 StringOperation::ClearAllSpace(str);
74 str = "str";
75 StringOperation::ClearAllSpace(str);
76 EXPECT_EQ(false, StringOperation::Compare(str, sep));
78 EXPECT_EQ(true, StringOperation::Compare(str, sep));
79 EXPECT_EQ(true, StringOperation::Find(str, sep));
80 str = "";
81 EXPECT_EQ(false, StringOperation::Find(str, sep));
/base/msdp/device_status/rust/utils/src/
Dmacros.rs91 log: Box<dyn Fn(&str, &str)>,
92 func_name: &'a str
97 pub fn new(log: Box<dyn Fn(&str, &str)>, func_name: &'a str) -> Self { in new() argument
118 Box::new(|func_name: &str, action: &str| {
133 Box::new(|func_name: &str, action: &str| {
/base/hiviewdfx/hidumper/frameworks/native/src/executor/
Dfd_output.cpp76 std::string str = line[j]; in OutMethod() local
78 NewLineMethod(str); in OutMethod()
82 write(rawParamFd, str.c_str(), strlen(str.c_str())); in OutMethod()
86 dprintf(fd_, "%s", str.c_str()); in OutMethod()
92 void FDOutput::NewLineMethod(std::string &str) in NewLineMethod() argument
94 if (str.find("\n") == std::string::npos) { // No line breaks in NewLineMethod()
95 str = str + "\n"; in NewLineMethod()
/base/update/updater/services/rust/hash_signed_data/src/
Dhsd.rs31 impl TryFrom<&str> for SingleSignedData {
33 fn try_from(value: &str) -> Result<Self, Self::Error> { in try_from()
34 const KEY_STR : &str = "Name:"; in try_from()
35 const VALUE_STR : &str = "signed-data:"; in try_from()
36 let res: Vec<&str> = value.split('\n').filter(|&s| !s.is_empty()).collect(); in try_from()
45 impl TryFrom<&str> for HashSignedData {
47 fn try_from(value: &str) -> Result<Self, Self::Error> { in try_from()
51 let all_hash_data: Vec<&str> = value.split("\n\n").filter(|&s| !s.is_empty()).collect(); in try_from()
62 pub fn get_sig_for_file(&self, file_name: &str) -> Result<Vec<u8>, String> in get_sig_for_file()
/base/powermgr/battery_manager/charger/include/
Dcharger_log.h25 inline void ReplaceHolder(std::string& str, const std::string& holder) in ReplaceHolder() argument
29 while ((index = str.find(holder, index)) != std::string::npos) { in ReplaceHolder()
30 str = str.replace(index, holderLen, ""); in ReplaceHolder()
37 std::string str(fmt); in ReplaceHolders()
38 ReplaceHolder(str, "{public}"); in ReplaceHolders()
39 ReplaceHolder(str, "{private}"); in ReplaceHolders()
40 return "[%s:%d] %s# " + str + "\n"; in ReplaceHolders()
/base/security/device_auth/deps_adapter/os_adapter/interfaces/liteos/
Dhc_log.h41 #define PRINT_SENSITIVE_DATA(tag, str) \ argument
43 if (HcStrlen((str)) < DESENSITIZATION_LEN) { \
46 LOGI("[" tag "]: %c%c%c%c****", (str)[DEV_AUTH_ZERO], (str)[DEV_AUTH_ONE], \
47 (str)[DEV_AUTH_TWO], (str)[DEV_AUTH_THREE]); \

12345678910>>...28