/ohos5.0/base/hiviewdfx/hiview/base/utility/test/unittest/common/ |
H A D | base_utility_unit_test.cpp | 75 ret = StringUtil::ReplaceStr(str, src, dest); 77 ret = StringUtil::ReplaceStr(str, src1, dest); 152 ret = StringUtil::IsValidFloatNum("123."); 154 ret = StringUtil::IsValidFloatNum(".123"); 156 ret = StringUtil::IsValidFloatNum("123.45"); 171 ret = StringUtil::GetLeftSubstr(origin, "v"); 175 StringUtil::GetRightSubstr(origin, "v"); 194 StringUtil::GetRrightSubstr(origin, "v"); 264 auto ret2 = StringUtil::StringToDouble(""); 266 ret2 = StringUtil::StringToDouble("abc"); [all …]
|
/ohos5.0/base/hiviewdfx/hiview/plugins/reliability/bbox_detectors/ |
H A D | bbox_detector_plugin.cpp | 149 name = StringUtil::GetRleftSubstr(name, ":"); in StartBootScan() 202 {"category", hisiHistoryPath_ ? StringUtil::GetMidSubstr(line, "category [", "]") : in GetValueFromHistory() 203 StringUtil::GetMidSubstr(line, "category[", "]")}, in GetValueFromHistory() 204 {"module", hisiHistoryPath_ ? StringUtil::GetMidSubstr(line, "core [", "]") : in GetValueFromHistory() 205 StringUtil::GetMidSubstr(line, "module[", "]")}, in GetValueFromHistory() 206 {"reason", hisiHistoryPath_ ? StringUtil::GetMidSubstr(line, "reason [", "]") : in GetValueFromHistory() 207 StringUtil::GetMidSubstr(line, "event[", "]")}, in GetValueFromHistory() 209 StringUtil::GetMidSubstr(line, "errdesc[", "]")}, in GetValueFromHistory() 211 BBOXPATH + StringUtil::GetMidSubstr(line, "time[", "]")}, in GetValueFromHistory() 213 {"subLogPath", hisiHistoryPath_ ? StringUtil::GetMidSubstr(line, "time [", "]") : in GetValueFromHistory() [all …]
|
/ohos5.0/base/hiviewdfx/hiview/framework/native/unified_collection/utils/ |
H A D | cpu_util.cpp | 33 return StringUtil::StringToUl(content); in GetIntegerFromFile() 39 StringUtil::SplitStr(cpuInfoStr, " ", splitStrs); in GetCpuUsageInfoFromString() 49 cpuInfo.userTime = StringUtil::StringToUl(splitStrs[parseIndex++]); in GetCpuUsageInfoFromString() 50 cpuInfo.niceTime = StringUtil::StringToUl(splitStrs[parseIndex++]); in GetCpuUsageInfoFromString() 51 cpuInfo.systemTime = StringUtil::StringToUl(splitStrs[parseIndex++]); in GetCpuUsageInfoFromString() 52 cpuInfo.idleTime = StringUtil::StringToUl(splitStrs[parseIndex++]); in GetCpuUsageInfoFromString() 53 cpuInfo.ioWaitTime = StringUtil::StringToUl(splitStrs[parseIndex++]); in GetCpuUsageInfoFromString() 54 cpuInfo.irqTime = StringUtil::StringToUl(splitStrs[parseIndex++]); in GetCpuUsageInfoFromString() 55 cpuInfo.softIrqTime = StringUtil::StringToUl(splitStrs[parseIndex++]); in GetCpuUsageInfoFromString() 88 StringUtil::SplitStr(loadContent, " ", loadStrs); in GetSysCpuLoad() [all …]
|
/ohos5.0/foundation/ai/intelligent_voice_framework/utils/ |
H A D | string_util.h | 27 class StringUtil { 29 StringUtil() {} in StringUtil() function 30 ~StringUtil() {} in ~StringUtil() 47 DISALLOW_COPY_AND_MOVE(StringUtil); 51 inline void StringUtil::TrimL(std::string &str) in TrimL() 62 inline void StringUtil::TrimR(std::string &str) in TrimR() 73 inline void StringUtil::Trim(std::string &str) in Trim() 90 inline std::string StringUtil::Int2String(int32_t arg) in Int2String() 101 inline void StringUtil::StringToLower(std::string &str) in StringToLower() 108 inline std::string StringUtil::StringToUpper(const std::string &str) in StringToUpper() [all …]
|
H A D | string_util.cpp | 33 void StringUtil::Split(const string &str, const string &sep, vector<string> &res) in Split() 53 std::vector<string> StringUtil::StringSplit(string &str, const string &pattern) in StringSplit() 72 template <typename T> string StringUtil::PrintVector(vector<T> &array, string &delimiter) in PrintVector() 85 void StringUtil::TrimSpecialChars(string &str) in TrimSpecialChars() 100 uint32_t StringUtil::CalSubStrNum(const string &str, const string &subStr) in CalSubStrNum() 116 bool StringUtil::SplitLineToPair(const std::string &line, std::string &first, std::string &second) in SplitLineToPair()
|
/ohos5.0/foundation/arkui/ace_engine_lite/frameworks/src/core/base/ |
H A D | string_util.cpp | 24 char *StringUtil::Copy(const char *sequence) in Copy() 33 char *buffer = StringUtil::Malloc(size); in Copy() 43 char *StringUtil::Malloc(const uint32_t size) in Malloc() 52 char *StringUtil::Slice(const char *sequence, const int32_t start) in Slice() 54 return StringUtil::Slice(sequence, start, strlen(sequence)); in Slice() 56 char *StringUtil::Slice(const char *sequence, const int32_t start, const int32_t end) in Slice() 73 char *buffer = StringUtil::Malloc(diffSize); in Slice() 83 bool StringUtil::StartsWith(const char *sequence, const char *subsequence) in StartsWith() 94 char *StringUtil::Trim(char *sequence) in Trim()
|
/ohos5.0/base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent_manager/ |
H A D | hisysevent_record_convertor.cpp | 32 return OHOS::HiviewDFX::StringUtil::CopyCString(recordStruct.domain, recordObj.GetDomain(), in ConvertDomain() 38 … return OHOS::HiviewDFX::StringUtil::CopyCString(recordStruct.eventName, recordObj.GetEventName(), in ConvertEventName() 44 return OHOS::HiviewDFX::StringUtil::CopyCString(recordStruct.tz, recordObj.GetTimeZone(), in ConvertTimeZone() 50 return OHOS::HiviewDFX::StringUtil::CreateCString(&recordStruct.level, recordObj.GetLevel()); in ConvertLevel() 55 return OHOS::HiviewDFX::StringUtil::CreateCString(&recordStruct.tag, recordObj.GetTag()); in ConvertTag() 61 …return OHOS::HiviewDFX::StringUtil::CreateCString(&recordStruct.jsonStr, recordObj.AsJson(), maxLe… in ConvertJsonStr() 66 OHOS::HiviewDFX::StringUtil::MemsetSafe(&record, sizeof(HiSysEventRecordC)); in InitRecord() 71 OHOS::HiviewDFX::StringUtil::DeletePointer<char>(&record.level); in DeleteRecord() 72 OHOS::HiviewDFX::StringUtil::DeletePointer<char>(&record.tag); in DeleteRecord() 73 OHOS::HiviewDFX::StringUtil::DeletePointer<char>(&record.jsonStr); in DeleteRecord()
|
/ohos5.0/base/hiviewdfx/hisysevent/test/moduletest/common/ |
H A D | hisysevent_manager_c_test.cpp | 157 StringUtil::DeletePointer<char>(&rule.condition); in QueryTestWithCondition() 183 StringUtil::DeletePointers<char>(¶ms, len); in RecordParamNameTest() 216 StringUtil::DeletePointer<char>(&testValue); in RecordParamStrValueTest() 230 StringUtil::DeletePointer<int64_t>(&testValues); in RecordParamIntValuesTest() 244 StringUtil::DeletePointer<uint64_t>(&testValues); in RecordParamUintValuesTest() 258 StringUtil::DeletePointer<double>(&testValues); in RecordParamDouValuesTest() 271 StringUtil::DeletePointers<char>(&testValues, len); in RecordParamStrValuesTest() 750 StringUtil::DeletePointer<char>(&rule.condition); 783 StringUtil::DeletePointer<char>(&rule.condition); 815 StringUtil::DeletePointer<char>(&rule.condition); [all …]
|
H A D | hisysevent_adapter_native_test.cpp | 332 auto ret = StringUtil::CopyCString(dest, src, 3); // 3 is a test length 334 ret = StringUtil::CopyCString(dest, src, 10); // 3 is a test length 338 ret = StringUtil::CreateCString(dest2pp, src, 3); // 3 is a test length 340 ret = StringUtil::CreateCString(dest2pp, src, 10); // 3 is a test length 342 ret = StringUtil::ConvertCString(src, dest2pp, 3); // 3 is a test length 344 ret = StringUtil::ConvertCString(src, dest2pp, 10); // 3 is a test length 356 ret = StringUtil::ConvertCStringVec(srcs1, dest3ppp, len); 359 ret = StringUtil::ConvertCStringVec(srcs2, dest3ppp, len); 363 StringUtil::MemsetSafe(reinterpret_cast<void*>(dest4), 3); // 3 is a test length
|
/ohos5.0/base/hiviewdfx/hiview/base/ |
H A D | audit_log_parser.cpp | 49 StringUtil::ConvertStringTo<uint64_t>(eventElements[LOG_ELEMENT_TIMESTAMP_POS], info.inTime); in CreateEventInfo() 59 StringUtil::SplitStr(log, sep, elements); in SplitStr() 79 StringUtil::ConvertStringTo<int>(elements[LOG_ELEMENT_EVENT_TYPE_POS], eventType); in StartParse() 162 StringUtil::ConvertStringTo<uint64_t>(beginLog[LOG_ELEMENT_TIMESTAMP_POS], logStartTime_); in ParseTimeScope() 164 StringUtil::ConvertStringTo<uint64_t>(endLog[LOG_ELEMENT_TIMESTAMP_POS], logEndTime_); in ParseTimeScope() 182 StringUtil::ConvertStringTo<uint64_t>(eventElements[LOG_ELEMENT_TIMESTAMP_POS], info.inTime); in ParseNormalEnqueueEvent() 194 StringUtil::ConvertStringTo<uint64_t>(eventElements[LOG_ELEMENT_SERIAL_ID_POS], eventSerialId); in ParseNormalDequeueEvent() 233 … StringUtil::ConvertStringTo<uint64_t>(eventElements[LOG_ELEMENT_TIMESTAMP_POS], info.createTime); in ParsePipelineCreateEvent() 243 StringUtil::ConvertStringTo<uint64_t>(eventElements[LOG_ELEMENT_SERIAL_ID_POS], eventSerialId); in ParsePipelineHandleInEvent() 264 StringUtil::ConvertStringTo<uint64_t>(eventElements[LOG_ELEMENT_SERIAL_ID_POS], eventSerialId); in ParsePipelineHandleOutEvent() [all …]
|
/ohos5.0/foundation/window/window_manager/utils/test/unittest/ |
H A D | string_util_test.cpp | 58 ASSERT_EQ("", StringUtil::Trim("")); 59 ASSERT_EQ("", StringUtil::Trim(" ")); 60 ASSERT_EQ("123", StringUtil::Trim(" 123 ")); 61 ASSERT_EQ("12 3", StringUtil::Trim(" 12 3 "));
|
/ohos5.0/foundation/arkui/ace_engine_lite/frameworks/src/core/stylemgr/ |
H A D | condition_arbitrator.cpp | 92 char *targetCondition = StringUtil::Slice(condition, 1, conditionLen - minTargetLen + 1); in JudgeCondition() 100 ConditionName conditionId = GetConditionName(StringUtil::Trim(conditionNameStr)); in JudgeCondition() 101 char *trimedTargetValue = StringUtil::Trim(targetValue); in JudgeCondition() 372 buff = StringUtil::Slice(recordPos, SLICE_FROM_CURRENT_POS, OPERATOR_BRACKETS); in DecomPositionConditions() 376 buff = StringUtil::Slice(recordPos, SLICE_FROM_CURRENT_POS, OPERATOR_AND); in DecomPositionConditions() 380 buff = StringUtil::Slice(recordPos, SLICE_FROM_CURRENT_POS, OPERATOR_OR); in DecomPositionConditions() 388 buff = StringUtil::Slice(conditions, SLICE_FROM_CURRENT_POS, len * sizeof(char)); in DecomPositionConditions() 401 buff = StringUtil::Slice(conditions, SLICE_FROM_CURRENT_POS); in DecomPositionConditions() 503 char *trimStr1 = StringUtil::Trim(const_cast<char*>(condition1)); in Calculate() 504 char *trimStr2 = StringUtil::Trim(const_cast<char*>(condition2)); in Calculate()
|
/ohos5.0/base/hiviewdfx/hiview/core/ |
H A D | plugin_config.cpp | 41 std::string strTmp = StringUtil::TrimStr(buf); in StartParse() 53 field = StringUtil::TrimStr(result[fieldNameField]); in StartParse() 120 pipelineInfo.pluginNameList = StringUtil::SplitStr(result.str(pluginNameListField)); in ParsePipeline() 135 std::string eventSourceName = StringUtil::TrimStr(result.str(pipelineGroupNameField)); in ParsePipelineGroup() 139 info.pipelineNameList = StringUtil::SplitStr(result.str(pipelineNameListField)); in ParsePipelineGroup()
|
/ohos5.0/base/hiviewdfx/hiview/core/param_update/src/ |
H A D | param_reader.cpp | 56 StringUtil::SplitStr(line, ":", strs); in VerifyCertFile() 62 StringUtil::TrimStr(sha256Digest); in VerifyCertFile() 95 StringUtil::SplitStr(nextline, ":", strs); in VerifyParamFile() 101 StringUtil::TrimStr(sha256Digest); in VerifyParamFile()
|
/ohos5.0/base/hiviewdfx/hiview/plugins/faultlogger/common/ |
H A D | faultlog_util.cpp | 137 StringUtil::SplitStr(fileName, "-", splitStr); in ExtractInfoFromFileName() 141 StringUtil::ConvertStringTo<int32_t>(splitStr[2], info.id); // 2 : index of uid in ExtractInfoFromFileName() 154 StringUtil::SplitStr(fileName, "-", splitStr); in ExtractInfoFromTempFile() 157 StringUtil::ConvertStringTo<int32_t>(splitStr[1], info.pid); // 1 : index of pid in ExtractInfoFromTempFile() 158 StringUtil::ConvertStringTo<int64_t>(splitStr[2], info.time); // 2 : index of timestamp in ExtractInfoFromTempFile() 166 StringUtil::SplitStr(name, "/", splitStr); in RegulateModuleNameIfNeed()
|
/ohos5.0/base/hiviewdfx/hiview/plugins/event_store/event_export/task/export/ |
H A D | event_write_handler.cpp | 88 …HIVIEW_LOGE("failed to move %{public}s to %{public}s", StringUtil::HideDeviceIdInfo(item.first).c_… in CopyTmpZipFilesToDest() 89 StringUtil::HideDeviceIdInfo(item.second).c_str()); in CopyTmpZipFilesToDest() 91 … HIVIEW_LOGI("zip file to export: %{public}s", StringUtil::HideDeviceIdInfo(item.second).c_str()); in CopyTmpZipFilesToDest() 107 … HIVIEW_LOGE("failed to delete %{public}s", StringUtil::HideDeviceIdInfo(item.first).c_str()); in Rollback()
|
/ohos5.0/base/hiviewdfx/hisysevent/frameworks/native/util/ |
H A D | string_util.cpp | 21 namespace StringUtil { namespace 57 StringUtil::DeletePointer<char>(&data); in ConvertCString() 76 StringUtil::DeletePointers<char>(&data, i); in ConvertCStringVec()
|
/ohos5.0/base/hiviewdfx/hiview/plugins/faultlogger/service/ |
H A D | faultlogger.cpp | 115 StringUtil::SplitStr(name, "-", out, true, false); in IsLogNameValid() 157 StringUtil::ConvertStringTo<time_t>(item, request.time); in FillDumpRequest() 197 std::string leftStr = StringUtil::GetLeftSubstr(summary, "Error message:"); in ParseJsErrorSummary() 198 std::string rightStr = StringUtil::GetRightSubstr(summary, "Error message:"); in ParseJsErrorSummary() 199 name = StringUtil::GetRightSubstr(leftStr, "Error name:"); in ParseJsErrorSummary() 200 stack = StringUtil::GetRightSubstr(rightStr, "Stacktrace:"); in ParseJsErrorSummary() 201 leftStr = StringUtil::GetLeftSubstr(rightStr, "Stacktrace:"); in ParseJsErrorSummary() 204 leftStr = StringUtil::GetLeftSubstr(leftStr, "Error code:"); in ParseJsErrorSummary() 208 leftStr = StringUtil::GetLeftSubstr(leftStr, "SourceCode:"); in ParseJsErrorSummary() 497 info.summary = StringUtil::UnescapeJsonStringValue(summary); in OnEvent() [all …]
|
/ohos5.0/base/hiviewdfx/hiview/utility/smart_parser/feature_analysis/ |
H A D | feature_analysis.cpp | 162 StringUtil::SplitStr(src, L3_OR_DESCRIPTOR, srcSplit, false, false); in IsMatchOrExpression() 176 StringUtil::SplitStr(src, L3_AND_DESCRIPTOR, srcSplit, false, false); in IsMatchAndExpression() 220 value = StringUtil::GetRightSubstr(param, L3_SEEK_LAST); in GetSeekInfo() 386 string result = StringUtil::VectorToString(results, false, tag); in ComposeParam() 395 StringUtil::SplitStr(param, COMPOSE_PLUS, params, false, false); in SplitParam() 397 StringUtil::SplitStr(param, COMPOSE_COLON, params, false, false); in SplitParam() 428 stackRegex_.emplace(pair(key, StringUtil::EraseString(regex, L3_VARIABLE_TRACE_BLOCK))); in SetStackRegex()
|
H A D | log_util.cpp | 129 std::string sourceFileName = StringUtil::GetRrightSubstr(sourceFile, "/"); in IsTestModel() 130 std::string dirOrFileName = StringUtil::GetRrightSubstr(name, "/"); in IsTestModel() 132 StringUtil::GetRrightSubstr(pattern, "/") : pattern; in IsTestModel()
|
/ohos5.0/base/hiviewdfx/hiview/utility/smart_parser/rule/ |
H A D | extract_rule.cpp | 126 string firstMatch = StringUtil::GetRightSubstr(featureId, "_"); in IsMatchId() 127 if (StringUtil::GetRleftSubstr(firstMatch, "_") == eventType) { in IsMatchId() 175 StringUtil::SplitStr(pattern, "@|@", paths, false, false); in IsMatchPath() 179 StringUtil::SplitStr(path, "/", parts, false, false); in IsMatchPath() 205 StringUtil::SplitStr(object[L2_FEATUREID].asString(), ",", result, false, false); in SplitFeatureId()
|
/ohos5.0/base/hiviewdfx/hiview/plugins/sysevent_source/ |
H A D | monitor_config.cpp | 43 std::string strTmp = StringUtil::TrimStr(buf); in Parse() 54 std::string configItem = StringUtil::TrimStr(result[configItemField]); in Parse()
|
/ohos5.0/base/hiviewdfx/hiview/adapter/service/server/src/ |
H A D | hiview_service_ability.cpp | 84 cmds.push_back(StringUtil::ConvertToUTF8(arg)); in Dump() 220 uid, isMove, logType.c_str(), StringUtil::HideSnInfo(logName).c_str()); in CopyOrMoveFile() 227 HIVIEW_LOGW("file: %{public}s not exist.", StringUtil::HideSnInfo(logName).c_str()); in CopyOrMoveFile() 240 …HIVIEW_LOGI("type:%{public}s, name:%{public}s", logType.c_str(), StringUtil::HideSnInfo(logName).c… in Remove() 252 HIVIEW_LOGW("file: %{public}s not exist.", StringUtil::HideSnInfo(logName).c_str()); in Remove()
|
/ohos5.0/base/hiviewdfx/hiview/framework/native/unified_collection/calculator/ |
H A D | io_calculator.cpp | 47 StringUtil::ConvertStringTo<int64_t>(sizeStr, eMMCSize); in GetEMMCSize() 63 int manfid = StringUtil::StrToInt(eMMCManfid); in GetEMMCManfid()
|
/ohos5.0/base/hiviewdfx/hiview/framework/native/unified_collection/collector/ |
H A D | io_collector_impl.cpp | 163 return StringUtil::StrToInt(fileName.substr(startPos + 1, endPos - startPos - 1)); in GetFileNameNum() 266 StringUtil::SplitStr(line, " ", items); in CalculateDiskStats() 277 currData.operRead = StringUtil::StringToUl(items[4]); // 4 : index of reads merged in CalculateDiskStats() 278 currData.sectorRead = StringUtil::StringToUl(items[5]); // 5 : index of sectors read in CalculateDiskStats() 279 … currData.readTime = StringUtil::StringToUl(items[6]); // 6 : index of time spent reading (ms) in CalculateDiskStats() 280 currData.operWrite = StringUtil::StringToUl(items[8]); // 8 : index of writes merged in CalculateDiskStats() 281 currData.sectorWrite = StringUtil::StringToUl(items[9]); // 9 : index of sectors written in CalculateDiskStats() 282 … currData.writeTime = StringUtil::StringToUl(items[10]); // 10 : index of time spent reading (ms) in CalculateDiskStats() 283 …currData.ioWait = StringUtil::StringToUl(items[11]); // 11 : index of I/Os currently in progre… in CalculateDiskStats() 515 int32_t pid = StringUtil::StrToInt(std::string(de->d_name)); in CalculateAllProcIoStats()
|